View Categories

Why some or all of the images cannot be optimized?

Due to the almost infinite number of combinations of different servers, configurations, websites, plugins, etc., it is sometimes difficult to determine exactly where the problem lies, although fortunately ShortPixel alerts you to it through various warning messages. So, first of all, you should find these error messages.

Where can you see the error messages?

Bulk optimization errors

Version 5.0.0 and newer

You will find the number of errors after each bulk optimization on the Bulk ShortPixel screen:

To learn more about these errors, click on the number link under the Errors column. There you will see all the errors, for example:

Version 4.22.10 and older

After a bulk optimization you will find the following on the Bulk ShortPixel screen:

To learn more about these errors, click on the ” Some have errors” link. There you will see all the error messages, for example:

Single optimization errors

If you optimize a single image from the Media Library (you need to be in the List view to do that), you will see the error message in the same Media Library. Example:

Causes

  • You are trying to optimize images on a localhost installation. Currently ShortPixel Image Optimizer does not work on such websites. More information.
  • Your website uses a firewall or security feature that denies allow our Image Optimization Cloud access to your website’s images. Make sure you whitelist our IPs from your security plugins, firewalls, hosting and/or CDN. There are situations when whitelisting IPs is not enough, as some hosting services block the ports we need to access your images. We also recommend that you contact your host and ask them to allow api.shortpixel.com access to port 80 (HTTP) and port 443 (HTTPS).
  • Your images have an SSL problem, although they can be viewed from a browser. If you have access to a terminal, please enter the command curl -I https://your_domain.com/wp-content/uploads/your_image.jpg and you may see something similar to below. If this is the case, please contact your hosting or CDN provider so they can help you resolve the issue:
  • Some plugins add lines to the .htaccess file, which prevents our servers from accessing your website’s images. You can easily test if this is the case for you by temporarily renaming your .htaccess file to .htaccess_test and see if ShortPixel Image Optimizer starts working.
  • You have several restrictive security rules set up on Cloudflare. Make sure you whitelist our IPs and check that there are no country-specific restrictions for Germany (this is where our servers are located). Here is a guide to potential Cloudflare issues and how to fix them.
  • Your website is in “I’m Under Attack” mode in Cloudflare. Please make sure to disable it (when you are not under attack) and try again. Here is a guide to potential Cloudflare issues and how to fix them.
  • Your website is password protected. If your website (frontend) is not publicly accessible and visitors need a user and password to connect to it, go to Settings > ShortPixel > Advanced and paste the credentials in the “HTTP AUTH credentials” field at the bottom.
  • Hotlink protection is enabled (e.g. via Plesk) and your website does not allow our servers to access the images directly.
  • The WP Hide plugin is installed and rewrites the URLs of our ShortPixel Image Optimizer plugin, preventing it from compressing the pictures. You can either deactivate it or try removing the ShortPixel-related rules from its settings.
  • One of your active plugins conflicts with ShortPixel. Try deactivating all your plugins (except ShortPixel) and see if that solves the problem.
  • Sometimes a new theme can conflict with ShortPixel. You may want to temporarily revert to an old/default WordPress theme and see if that makes a difference.
  • Incorrect WordPress settings. Please check if the URL of your website is set correctly in Settings > General.
  • Incorrect file or folder permissions. Please contact your hosting provider to make sure you have the correct file and folder permissions. More information.
  • Incorrect file or folder owner and/or group. Please contact your hosting provider to make sure you have the correct file and folder owner and group.
  • Insufficient disk space. If your server does not have enough disk space during optimization, you may experience all kinds of problems. Please contact your hosting provider to make sure that you have sufficient available disk space.
  • If your server has insufficient server resources (which is very common with shared hosting providers), you may experience a slowdown or sometimes the images will not be optimized at all. Try stopping the optimization and try again in in a few minutes. More information.
  • Your website has been recently migrated to another hosting provider and this has caused one of the problems mentioned above. More information.
  • Your website was recently migrated to another hosting provider and you have a custom uploads folder (using, for example, this plugin). It is possible that you then have some connection errors with ShortPixel. If this is the case and you are indeed using a custom uploads folder, you will need to either update it in the settings of the plugin you are using or check if there is a custom path defined on Settings > Media. If there is a custom path there, you simply need to remove it and WordPress will revert to the default path. Alternatively, you can restore the default path by adding the following to your wp-config.php file: define( 'UPLOADS', 'wp-content/uploads' );
  • Your WordPress Address and Site Address (WordPress dashboard > Settings > General) are with HTTP (and not HTTPS). Our plugin creates the paths of the files it needs from these settings and because the actual site is served using HTTPS, there is a clash/error when trying to load a JS file from HTTP.
  • You are using Ezoic, which decided to convert all the images on their clients’ sites to WebP format, but continue to serve them via the original URL (JPG, PNG, etc). On the one hand, this means that there may still be users with outdated browsers who can’t view the images on your website because their browsers don’t support WebP. On the other hand, our plugin encounters an error when trying to optimize your images, because it downloads a WebP file with a JPG extension instead of the actual JPG file. Please contact Ezoic and ask to disable this automatic conversion so that our plugin works properly. Otherwise, the plugin will continue to produce these errors. Have a look here for an example of a customer with this issue.
  • You are using quic.cloud and have hotlinking protection turned on. To disable it, you need to be on their standard plan. If you’re on the free plan, you will need to either upgrade to the standard plan and disable the hotlinking protection, or disable quic.cloud altogether for our servers to access the images.

If you are trying to troubleshoot individual images that do not get optimized, one of these may be the reason:

  • The images (or their thumbnails) are listed in the Media Library (or database), but they no longer exist on disk. A quick solution to this problem is to use a plugin like Enable Media Replace to replace the missing images with new ones. ShortPixel should then automatically detect the new image and optimize it along with the thumbnails.
  • Some of the thumbnails are not publicly available or do not exist. To check this: Open your Optimization Report (How to interpret the Optimization Report) and look for files that ShortPixel could not download – in the Details column you will see if there was a problem. A possible solution to this kind of problem is to use reGenerate Thumbnails Advanced to regenerate your thumbnails.
  • Sometimes the images are not images at all. If that’s the case, the website returns an HTML file with HTTP code 200 (which means “all OK”), but ShortPixel cannot perform the optimization. Here you can check if your image has a problem: https://checkfiletype.com/
  • Sometimes a file has been deleted incorrectly or by mistake, so ShortPixel tries to optimize it even though it no longer exists. Please clean your database with a database cleaner like WP-Optimize and then try again.

You can also try searching our knowledge base for the exact error: ShortPixel Knowledge Base