Extend add missing image dimensions feature
By default, the Add missing image dimensions feature will not be applied on:
- Externally hosted images, i.e. not hosted on your own domain
- Images within <picture> tags
It's possible to force the feature to be applied on one or both of these kinds of images, by using the helper plugin below.
⚠️ Applying this feature on externally hosted images could increase the cache generation time.
📝 Manual code edit required before use!
- Download the helper plugin zip file, then un-zip it.
- Open the PHP file in a text editor.
- To apply the feature on external images:
Remove//
at the start of line 27 - To apply on images inside <picture> tags:
Remove//
at the start of line 22 - After making the edits, save the PHP file
- Re-zip the folder.
- Install the helper plugin on your site - go to Plugins → Add New → Upload plugin and select the zip file.
- Activate the plugin
- Clear the WP Rocket cache
📥 Download (.zip): WP Rocket | Image Dimensions for picture and external images
Developers: You can find the code for this plugin on GitHub.