How to use Cloudflare with ShortPixel Adaptive Images

Note: If you're having SiteGround as your hosting provider you  cannot properly set Cloudflare and use it as a CDN together with ShortPixel Adaptive Images. For more information, visit this page: CDN via Cloudflare for websites hosted at SiteGround, it this possible?

If you want to use Cloudflare as your CDN when using ShortPixel Adaptive Images, instead of ShortPixel's CDN, follow these steps:

  1. Log in to your Cloudflare account.
  2. Select your website and then the DNS section from the side menu.
  3. Think of a name for the subdomain from which you want the images to be delivered. For example, if your domain is, you could choose
  4. Following the previous example, add a new CNAME record from to

    Remember that should be changed to your actual domain, and that img should be changed to something else if it's already used by another CNAME, like or

    Important! The small cloud must be orange in order for you to use the CDN features offered by Cloudflare.
  5. Wait 5 minutes for Cloudflare to complete all the technical tasks in the background.

  6. Take any image URL from your site, append it to and make sure that the new URL can be accessed. Example:

    1. If your website is called, your new CNAME on Cloudflare is , and your sample image is,
    2. try calling this URL:
    3. Can you view it without errors? Continue with the next step.
  7. Go to Settings > ShortPixel AI > Behaviour and enter in the API URL field

    1. Replace with your actual domain name.
    2. Replace the img part if your subdomain is different, like configured above.
  8. Clear the CSS cache from ShortPixel AI's settings:

  9. Clear your WordPress cache: How to clear WordPress cache

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us