WebP Attachment Data Converter

This is a one-time quick-use WordPress plugin that converts data for existing images to WebP. After using the plugin to do this task, you can delete it.

(This plugin is meant to go with this article.)

This will convert existing data in the WordPress database for your JPEG, JPG, and PNG images. It will turn it into WebP data so that WordPress will know to show your new WebP images instead of the old JPEG/JPG/PNG images.

Note: Before using this plugin, you must have already uploaded your WebP images to your server, for example via FTP. If you don’t, then this plugin does nothing.

What Will Be Updated?

Data in the database will be updated for the original images, and also for all their sized images. But only if the replacement WebP image already exists in the uploads folder. This is why the note above says, “Before using this plugin, you must have already uploaded your WebP images to your server, for example via FTP.” If a WebP image exists, then these changes will be made:

  • Attachment post data, postmeta and metadata will be updated to the new WebP file extension. That includes all attachments, featured images, images inserted into post content (their extension will be updated in the post content to WebP), and all extra sizes including thumbnails and any custom sizes.

  • Their image dimensions (pixel width and height) will not be changed in the database; that will remain the same.

  • Image EXIF data will be deleted from the database for these images. This can very easily be changed in this plugin’s code if you want to keep the EXIF data.

    To keep the EXIF data, remove the double slashes at the beginning of line 187 in the plugin file. That line is commented out, so you just make that line active, and it will take care of keeping your EXIF data in the database.

    Note: EXIF data is not deleted from your actual image files, it’s only deleted from the database; see next point for clarification.

  • This plugin does nothing for future uploads, and will not convert any images that you upload later. This plugin is only a one-time update for existing images.

Actual Images Are Untouched

Your actual image files will not be touched. This only updates database data. This does nothing to the actual image files. It will be up to you to later delete your old JPEG, JPG, and PNG images, if you want to. Otherwise, they will remain on your server untouched by this plugin.

Types Of Images Affected

This will only convert data for images of type JPEG, JPG, or PNG. It will not do anything for GIF nor other image formats.

To Use This Plugin

  1. Before using this plugin, you must have already uploaded your WebP images to your server, for example via FTP. If you don’t do this step, then this plugin will do nothing.
  2. Download the plugin ↓

  3. Install and activate the plugin in your WordPress admin Plugins page.
  4. Click on the new menu item in your WordPress dashboard, “WebP Attachment Data Converter.”
  5. Read everything on that page. Then click the button to CONVERT DATA NOW. You will get a summary of results.
  6. You can then delete the plugin.

See more:

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]