I installed ShortPixel Adaptive Images but it doesn't seem to work

General issues

If you installed ShortPixel Adaptive Images (SPAI) on your website and, after checking if it's working well, it doesn't seem to do it, then the usual reasons are:

  • Your domain is not associated to your account: How can I associate a domain to my account?
  • You don't have enough available optimization credits. If this is the case, please purchase a new plan, or in case you have a monthly quota, upgrade your plan.
  • The API URL is not correct. It is located on Settings > ShortPixel AI > Behaviour and by default it should be "https://cdn.shortpixel.ai/spai" (see image below); only change it if you know what you're doing.
  • You use a caching plugin or your hosting provider uses a caching mechanism, and the cache has not been flushed after installing and configuring SPAI. The solution is to flush your cache to get rid of old image URLs being displayed. To do a proper cache clearing, please read this article: How to clear WordPress cache
  • There is another plugin or theme that has a lazy loading feature activated and this conflicts with SPAI. The solution is to deactivate this functionality on the plugin or theme that use it. Please notice that you don't need to disable lazy loading on videos or other resources; only image lazy loading must be disabled.
  • Your images are already being delivered as WebP. Please deactivate any other WebP delivering method that is not provided by ShortPixel Adaptive Images.
  • SPAI's JavaScript files are blocked or unregistered with another optimization plugin. For example, Asset CleanUp can stop such Javascript files if you tell it to do so. Please check all the optimization plugins to make sure that they don't block anything related to SPAI.
  • jQuery has been disabled either manually or by another plugin. In this case, SPAI will not work properly. Please make sure jQuery is enabled.
  • Your hosting provider is SiteGround and you are working on a staging site. The way SiteGround creates staging sites is a little bit different: they are using a filter to replace the domain names in the URLs. Please ignore any malfunction in this case, as the live site will probably work correctly.
  • There is a conflict with another plugin (the known conflicts are listed below).

Only some images are not optimized

Sometimes SPAI is actually working correctly, but not all the images are being served from our CDN. This can happen because:

  • The images are background images ("background-image" CSS property) declared in .css files. Please activate the "Replace in CSS files" option.
  • The piece of content containing that image is built dynamically by Javascript (either the theme's or from a plugin). Please activate first the "Replace in JSON data" option (located on Settings > ShortPixel AI > Areas), and if there still are images not optimized, activate the "Replace in the JS blocks" option too. If neither of these solve all the cases, it might be that the dynamical part is built by a different means and we might need to code a custom integration for this situation. Please contact us to check if this is possible in your case.

Known conflicts and solutions

LiteSpeed Cache

  • You need to disable the option "JS Combine". Go to LiteSpeed Cache > Page Optimization > JS Settings and there disable "JS Combine" or, possibly better, exclude "ai.min.js" from being combined. (thanks to Mads).


  • You need to disable Jetpack's Site Accelerator. Go to Jetpack > Settings > Performance and disable the option "Enable site accelerator".


  • You need to exclude our script "ai.min.js" from optimization. Go to Hummingbird > Asset Optimization > Assets > Configuration > Exclusions, and look for the file "ai.min.js" to exclude it.

  • In some cases, the previous instructions won't be enough. We have seen that the Hummingbird plugin will sometimes disable jQuery. Currently, ShortPixel Adaptive Images requires jQuery to function so, if you did the above and ShortPixel still doesn't work properly, please uninstall Hummingbird and/or use a better cache plugin.


  • You need to have "Optimize Images" and "Lazy load" turned off. They are located on Settings > Autoptimize > Images.

  • If you are aggregating the JS files, you may need to exclude the script "ai.min.js" from optimization to prevent possible conflicts.

WP Rocket

  • Do not add the ShortPixel API URL to WP Rocket's CDN section.
  • Do not activate the option "Enable WebP caching" on the Media section. If you'd like to use WebP, please activate it from ShortPixel Adaptive Images' options.
  • You must deactivate lazy loading for images. Go to Settings > WP Rocket > Media > LazyLoad and disable "Enable for images".
  • If you combine your JS files using WP Rocket, you may need to exclude the file "/wp-content/plugins/shortpixel-adaptive-images/assets/js/ai.min.js" from being minified and combined (Settings > WP Rocket > File Optimization > JavaScript Files).
  • If excluding does not seem to work, try deactivating the "Combine JavaScript files" option:

  • If you are using RocketCDN to serve your images files as well, then you should do one of the following:
    • Either associate your RocketCDN CNAME to your account (How can I associate a domain to my account?):
    • Or exclude all your JPG, PNG and GIF files from being served from RocketCDN. This method has the benefit of not having 2 CDNs (RocketCDN and SPAI) before your images:
  • If you are using the option Delay JavaScript execution, you will need to exclude the following:
    • /wp-includes/js/jquery/(.*).js
    • /wp-content/plugins/shortpixel-adaptive-images/assets/js/(.*).js

Swift Performance

  • You will need to disable the option "Fix Invalid HTML" under Swift Performance > Settings > Optimization > General.

  • Some websites may have issues with the option " Merge styles" under Swift Performance > Settings > Optimization > Styles. If you want it enabled, feel free to try to enable it, and then check your site. If the site breaks, then you should disable it.

  • If you are using ShortPixel Adaptive Images to deliver WebP, then you have to go to Settings > Swift Performance > Media > Images and set the option "Serve WebP" as "Don't use WebP".

SG Optimizer

  • First, make sure you have disabled the lazy load option on SG Optimizer > Media Optimization > Lazy Load Media.

  • And also, to make sure that your images load as fast as possible, disable the option SG Optimizer > Frontend Optimization > Defer Render-blocking JS.

WP Fastest Cache

  • Make sure that "Lazy Load" and "Minify JS" are disabled from WP Fastest Cache's settings.


  • Deactivate the Lazy Loading option in Perfmatters' settings to allow SPAI to work correctly. SPAI has already lazy load integrated.

Slider Revolution

  • Deactivate the Lazy Loading of your sliders by going to the slider settings.

W3 Total Cache

  • Deactivate the JS Minify settings. Go to Performance > Minify > JS and turn off the option "JS minify settings"


  • You will have to enable CSS Caching inside Oxygen's settings to get rid of the xlink=css files.

Asset CleanUp

  • Do not unload, async or defer any file from ShortPixel Adaptive Images. If you do so, the plugin will stop working as it should and you could have missing images or parts of the plugin not working as they should.

Divi, Extra or any other Elegant Themes theme

  • Disable the option "Defer jQuery And jQuery Migrate". It is located on your Theme Options, under the General > Performance menu.

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