Back to Community

Troubleshooting Autoptimize: Fixing Images That Won't Load

12 threads Sep 9, 2025 PluginAutoptimize

Content

If you're using Autoptimize and notice that some or all of your website's images have stopped loading, you're not alone. This is a common issue reported by users, but the good news is that it's often easily fixable by identifying which specific optimization is causing the conflict.

Why This Happens:
Autoptimize works by optimizing your site's code and assets to improve performance. However, themes and other plugins can sometimes rely on specific JavaScript or CSS being loaded in a particular way. When Autoptimize aggregates, minifies, or defers this code, it can break the functionality that controls how images are displayed or loaded, especially with lazy-loading scripts.

How to Identify the Cause:
The first and most critical step is to isolate which optimization setting is causing the problem. The 'Autoptimize' team and community consistently recommend this diagnostic process:

  1. Go to Settings → Autoptimize in your WordPress admin dashboard.
  2. Disable one of the main optimization options (e.g., JavaScript, CSS, HTML, or Image Optimization including lazyload).
  3. Save your changes and clear any page caches you are using (Autoptimize's, your hosting's, or another plugin's).
  4. Check your site's frontend to see if the images have reappeared.
  5. Repeat this process, testing each option individually, until you find the one that resolves the issue.

Based on the sample threads analyzed, the culprit is most frequently JavaScript Optimization.

Common Solutions:

1. If JavaScript Optimization is the Cause

If disabling 'Optimize JavaScript Code?' fixes the images, you have several paths forward instead of leaving JS optimization off entirely:

  • Try a Different JS Optimization Method: Instead of aggregating JS files, try enabling the 'Defer JavaScript' option. This method, which is now the default for new installations, can often resolve conflicts while still providing performance benefits, especially on HTTP/2 servers.
  • Exclude Specific Scripts: You may need to exclude a problematic JavaScript file from optimization. If you are also using a lazy-loading plugin like Jetpack, its script is a common candidate for exclusion. Add the script's identifier to the 'Exclude scripts from Autoptimize' field in the JS settings.

2. If Image Optimization is the Cause

If the issue only occurs when 'Optimize Images' is enabled, it could be a temporary issue with the external image optimization CDN (Shortpixel). As seen in one thread, these are sometimes resolved on the CDN's end. Try disabling the image optimization feature, wait a while, and then re-enable it to see if the problem persists.

3. General Troubleshooting Tips

  • Always Clear Cache: After making any setting change in Autoptimize or other caching plugins, always clear your site's cache to ensure you are seeing the latest result.
  • Check the Browser Console: With JavaScript optimization active, open your browser's developer tools (F12) and look at the 'Console' tab for any red error messages. Errors like 'jQuery is not defined' can point to a script that needs to be excluded.
  • Plugin Conflicts: If problems persist even with all Autoptimize options disabled, the issue might be a conflict with another optimization or caching plugin. Test by temporarily disabling other performance plugins to identify the conflict.

By methodically testing each option, you can usually pinpoint the conflict and find a configuration that keeps both your images visible and your site optimized.