WebP Uploads and automatic image file conversion in WordPress
I recently investigated how WordPress handles the supposedly more performant WebP image type. This brought me to the Modern Image Formats plugin (formerly “WebP Uploads”), which I am looking into more deeply here.
WebP without a plugin
This article provides information for users who prefer to use the WebP image format but keep uploading JPEG files.
You don’t need any plugins if WebP is your original format. Since version WordPress 5.8 – that is 2021 – you can upload and display WebP files without a plugin.
Performance Labs > WebP Uploads > Modern Image Formats
The Modern Image Formats plugin was originally part of the Performance Lab plugin. This is a plugin by the WordPress community aiming to improve the speed of WordPress sites. Eventually, the features might become part of the WordPress core.
In September 2023, the image features moved out of the Performance Lab plugin into a new plugin called “WebP Uploads”. In April 2024, that plugin was renamed “Modern Image Formats”. The slug webp-uploads
in the WordPress plugin repository is kept, though.
Shortly before originally writing this post, I updated Performance Lab to version 2.8.0 and was prompted with a message that certain features are now individual plugins. Modern Image Formats is just one of many of them.
Modern Image Formats – what does it do?
I first learned about the performance benefits of WebP uploads when analyzing my sites with Google PageSpeed Insights. For years now, they have suggested using “modern” image formats.
By the way., Google itself developed the WebP format and published it in 2018. So, no wonder they are promoting it. For a long while, I hesitated to use WebP because it wasn’t supported by all popular browsers. Luckily, this has changed.
As you can see on the screenshot, Google also suggests using the Performance Lab plugin.
Convert JPEG into WebP automatically
When you upload a new JPEG image (not PNG or GIFs!), the Modern Image Formats (previously WebP Uploads) plugin automatically converts it into the WebP format. It also creates different sizes of images to display on smaller devices.
However, this only applies to images uploaded after the plugin was installed.
As usual, the WebP images show up in your Media Library, and you can find them in the wp-content/uploads
folder.
The original JPEG file is also stored on your server but not displayed in the frontend anymore.
The Modern Image Formats plugin only does its magic on upload. Once the image is uploaded and converted, you could theoretically remove the plugin, and the WebP images will still appear.
You can also create JPEG files of different sizes – as WordPress would normally do – alongside the WebP files. To do that, enable the option Settings > Media > Uploading Files > Generate JPEG files in addition to WebP.
Again, this option only affects newly uploaded images and would not generate resized JPEG files for older uploads.
Convert existing images into WebP
As mentioned, the Modern Image Formats plugin would not convert existing images into the WebP format.
I can only imagine how hard this would be to implement since WordPress often stores exact URLs in the content. Just converting an image into a new format could invalidate such URLs and cause the image not to appear.
There are multiple solutions to converting existing images into WebP. Below, I list three solutions I have an opinion about, though I am only actively using one of them.
Be aware that none of the mentioned solutions are free. Many need a subscription. Some come with a free plan. I guess image compression is costly or just simpler to do on the vendor’s hardware than on unknown WordPress installations.
There is no affiliate relation between me and any of the mentioned solutions.
ShortPixel
Many years ago, I was lucky to get a lifetime deal for ShortPixel. Since then, it has run on one of my blogs. It allowed me to convert existing images into WebP and do that on the fly for new ones.
Imagify
I am a huge fan of the WP Rocket caching plugin. Naturally, their Imagify plugin comes to mind when thinking about image optimization. They have a free tier that should suffice for many small sites.
Smush
An argument to try Smush by WPMU DEV is the astonishing number of more than 1 Mio active users, according to wordpress.org. I never used it personally, but I have seen it installed on many sites running my Image Source Control plugin.
Conclusion
What have we learned?
You don’t need a plugin to upload and use WebP files.
Use the free Modern Image Formats plugin to convert newly uploaded JPEG files into WebP.
You might need a proprietary plugin or service to convert existing images into WebP.
Check out Image Source Control to display author attributions to your uploaded images.
Questions? Feedback? How can I help?
Reach out directly via the contact form.