Force WebP replacement on more attributes

WP Rocket's WebP Compatibility looks for images in specific attributes to replace them with the WebP version. If you have an image found in an unsupported attribute, you can force the WebP replacement by using this helper plugin.

📝 Manual code edit required before use!
You must edit the line beginning with $attributes[] to reflect the custom attribute(s) you want to use.

📥   Download (.zip):  WP Rocket | Add WebP Target Attribute
Developers: You can find the code for this plugin on GitHub.

  1. Download the helper plugin zip file, then un-zip it. 
  2. Open the PHP file in a text editor. 
  3. Edit line 31 to replace data-thumb with the attribute you want to use, and save the file. To add multiple attributes, duplicate line 31 as needed, for each attribute you want to add. 
  4. Re-zip the folder. 
  5. Install the helper plugin on your site - go to Plugins → Add New → Upload plugin
    and select the zip file. 
  6. Activate the plugin 
  7. 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.