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!
- After downloading the plugin zip file, unzip it and open the PHP file in a text editor.
- 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', ];
- 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.
- After making your edits, save the PHP file and re-zip the plugin.
- In your WordPress site, go to Plugins > Add New > Upload Plugin and upload the zip file.
- Activate it and then clear the WP Rocket cache.