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 cdn.shortpixel.ai , 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 example.com and you choose cdn subdomain, your images will be served from cdn.example.com .
  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. cdn.example.com ) pointing to cdn.shortpixel.ai . 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 https://cdn.example.com/spai where cdn.example.com 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).

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