Disable Missing Image Dimensions on Specific Images

If the Add Missing Image Dimensions feature causes a problem with any specific images, it's possible to exclude them with the following helper plugin. 

📥   Download (.zip):  WP Rocket | No Automatic Width/Height for Custom Image Sources
Developers: You can find the code for this plugin on GitHub.

📝 Manual code edit required before use!

  1. After downloading the plugin zip file, unzip it and open the PHP file in a text editor.
  2. Look for the following sample image paths in the code.
    Replace these with the real image URLs you want to exclude:
    	$excluded_src = [
    		'https://domain.ext/path/to/image.ext',
    		'https://domain.ext/path/to/image-2.ext',
    	];
    
  3. If you only need to exclude one image, you may remove the second line in the example.
    If you need to exclude more images, you may keep adding as many lines as necessary.
  4. After making your edits, save the PHP file and re-zip the plugin. 
  5. In your WordPress site, go to Plugins > Add New > Upload Plugin and upload the zip file. 
  6. Activate it and then clear the WP Rocket cache.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.