How can I set up SPAI to serve images from a custom subdomain?

Note: If you are on a free plan or have purchased one-time credit packages, you will not be able to add a custom subdomain. Custom subdomains are exclusively available for users who have subscribed to an unlimited or monthly/yearly plan.

If you want to use your own custom (sub)domain when using ShortPixel Adaptive Images, instead of , follow these steps:

  1. Log in to your ShortPixel account and from the dashboard, click Associate Domains.
  2. Click 'Set Custom Domain' on the right side of your associated domain.
  3. Think of a suitable subdomain name for the delivery of your images, such as cdn , img , images , media , and so on. For example, if your website is and you choose cdn subdomain, your images will be served from .
  4. Enter your preferred subdomain name and then click the red 'Setup Custom Domain' button.

  5. Navigate to your domain's DNS records, and add the CNAME indicated (eg. ) pointing to . If you're unsure how, please contact your hosting provider for assistance.
  6. Once the CNAME record has finished propagating, you can return to your ShortPixel dashboard where you should find the subdomain added to your list of associated domains. If it doesn't appear, you may try refreshing the page.

  7. Navigate to your WordPress admin dashboard > Settings > ShortPixel AI > Behavior > API URL, and change the default URL to where is the subdomain that you've set up above.

  8. Refer to this article and follow the instructions provided under the 'Testing ShortPixel Adaptive Images' section to confirm whether your images are being served from your custom subdomain.

Important: If the images are not served from your custom subdomain after setting everything up, please make sure you flush your website's cache (whichever is applicable – caching plugin, server cache, CDN cache, and browser cache).