We understand the importance of balancing image quality with faster loading times. Many website owners ask us about the best way to use WebP images to do just that.
WebP images are a modern image format that offers better image compression by reducing the file size without significantly sacrificing image quality. This makes your website load faster and saves bandwidth.
The problem is, that WordPress doesn’t natively support uploading or displaying WebP images.
In this article, we will show you how to easily use WebP images in WordPress.
What Is WebP?
WebP is a newer file format for images to be used on the web. By using the WebP image format, your images will be 25-34% smaller in file size than PNG and JPEG without losing quality.
If images are slowing down your website, then converting them to WebP format can improve your page load speed test scores.
You can learn about image compression in our guide on how to optimize images for the web.
Since WebP is a new file format, it is not yet supported by all browsers. However, most modern browsers, like Google Chrome, Firefox, and Microsoft Edge, support WebP images.
Should You Use WebP Images in WordPress?
WebP images can help you speed up your WordPress website. It is a recommended best practice to be used along with a WordPress caching plugin, CDN, and more.
Since WordPress 5.8, WordPress has supported WebP images by default. This means you can save and upload your WebP images to your WordPress website without using a plugin.
But having said this, you still might like to use an image compression plugin on your WordPress site. If many of your users use unsupported browsers, then you should consider using an image compression plugin.
Image compression plugins can convert your existing images into the WebP format and display JPEG or PNG images as the fallback option on browsers that don’t yet support WebP.
If your site uses lots of images, and they are slowing down your WordPress blog, then you should definitely consider using WebP images.
Here is how to use WebP images in WordPress. We will show you multiple methods so you can choose one that works best for you:
Video Tutorial
If you prefer written instructions, then just keep reading.
Method 1: Using WebP Images in WordPress With EWWW Optimizer
EWWW Image Optimizer is one of the best WordPress image compression plugins that allows you to optimize your WordPress images. It also supports WebP Images and can automatically show them on supported browsers. See our EWWW Image Optimizer review for more details.
The first thing you need to do is install and activate the EWWW Image Optimizer plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, go to the Settings » EWWW Image Optimizer page to configure plugin options. You will be greeted by a setup wizard, but you can click on the ‘I know what I am doing’ link to exit the wizard.
On the next screen, you will see a bunch of plugin options.
Scroll down and check the box next to the ‘WebP Conversion’ option.
After that, click on the ‘Save Changes’ button to store your settings.
Next, you need to scroll down to the WebP Conversion section. The plugin will now show you some rewrite rules with a red preview image.
You need to click on the ‘Insert Rewrite Rules’ button, and the plugin will automatically try to insert these rewrite rules into your .htaccess file.
If the plugin is successful in adding those rules, then the red image preview will turn green with the ‘WebP’ text.
Sometimes, the plugin may not be able to insert the rules. In that case, you need to copy the rewrite rules from the plugin’s settings page and paste them at the bottom of your .htaccess file manually.
Once you are done, return to the plugin’s settings page and click on the ‘Save Changes’ button again. If the preview image turns green, then this means you have successfully enabled WebP image delivery on your WordPress website.
Alternatively, you can choose from JS WebP Rewriting or WebP Rewriting methods as your WebP delivery options. These are a little slower than the .htaccess method, but they will get the job done.
Bulk Convert Your Old Images to WebP Versions
EWWW Image Optimizer allows you to easily convert your previously uploaded image files to WebP images. Simply go to the Media » Library page and switch to the list view.
Next, you need to click on the ‘Screen Options’ button and change the ‘Number of items per page’ to 999. If you have 1000+ images, then those images will appear on the next page.
This way, you will be able to quickly select a large number of images for bulk optimization. Next, click on the Select All checkbox at the top to select all images.
After that, click on the ‘Bulk Actions’ dropdown menu and select the ‘Bulk Optimize’ option. Finally, click on the ‘Apply’ button.
On the next screen, the plugin will give you the option to skip the image compression and only convert them to WebP. You can check this option if your images are already optimized.
After that, click on the ‘Scan for Unoptimized Images’ button to continue. The plugin will then show you the number of images it found, so you can click on the Optimize button to proceed.
Your images will now be optimized, and EWWW Optimizer will generate WebP versions for your images.
Testing Your WebP Image Delivery
Once you have optimized your images, you can go to a blog post containing several images.
Take the mouse over to any image and right-click to open the image in a new tab.
This will open the image in a new browser tab.
You’ll be able to see that it has a .webp
extension in the address bar.
If the plugin is unable to serve the WebP image, then you can go back to the plugin’s settings page. From here, you can change the WebP delivery option to the ‘JS WebP Rewriting’ or ‘WebP Rewriting’ methods.
Method 2: Using WebP Images in WordPress With Imagify
Imagify is a WordPress image optimization plugin created by the folks behind WP Rocket, the best WordPress caching plugin. It allows you to easily optimize and convert images to WebP image format. See our Imagify review to learn more.
The first thing you need to do is install and activate the Imagify plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit the Settings » Imagify page to configure plugin settings. From here, click on the ‘Create a Free API Key’ button to continue.
You’ll be asked to enter a business email address. After that, you can check your inbox for an email containing your API key. Copy and paste the key into the plugin’s settings page and click on the ‘Save Changes’ button.
Next, you need to scroll down to the Optimization section. There you need to check the options next to the ‘Create webp versions of images’ and ‘Display images in webp format on the site’ options.
Below that, you can choose from two delivery methods to display WebP images in WordPress. The first one is the .htaccess method, and the second one is using a tag.
The .htaccess method is faster, but it does not work if you are using a CDN service. The tag method works with CDNs, too, but it may break some WordPress themes.
You can choose either one that works well for your site. After that, click on the ‘Save & Go to Bulk Optimizer’ button at the bottom.
This will bring you to the Media » Bulk Optimization page.
The plugin will automatically start optimizing all your WordPress images in the background.
If you have a lot of images, then this may take a while. Don’t worry, you can close the page and come back to it later because closing the page will not stop the image optimization process.
Testing Your WebP Images in WordPress
Once the optimization is done, you can visit a page or post containing a few images. Take your mouse over to an image and then right-click to select ‘Open image in new tab’.
This will open the image in a new browser tab.
You’ll be able to see .webp
extension in the address bar.
Method 3: Using WebP Images in WordPress With SG Optimizer
This method is recommended if you are a SiteGround user.
SiteGround is one of the best WordPress hosting companies. They offer a free SG Optimizer plugin to their users, which allows you to optimize your WordPress performance. It also includes the option to optimize WordPress images.
First, you need to install and activate the SG Optimizer plugin.
Upon activation, the plugin will add a new menu item to your admin sidebar labeled ‘SG Optimizer’. Clicking on it will take you to the plugin’s settings page.
From here, you can turn on the caching settings if you want to use SiteGround’s built-in caching system.
After that, you can switch to the Media Optimization tab and turn on the ‘Generate WebP Copies of New Images’ option.
Below that, you will see the option to ‘Bulk Generate WebP Files’.
Clicking on that option’s toggle button will start generating WebP copies for all image files in your WordPress media library.
Once finished, your WordPress site will start serving WebP images.
Testing WebP Images in SG Optimizer
To see if your website is serving WebP images, you need to open a page on your site with a few images.
After that, right-click and select the Inspect tool. This will open the developer console, where you need to switch to the Network tab.
From here, click on the ‘img’ tab and then reload the page (CTRL+R on Windows and Command+R on Mac). As your website reloads, you will see all the images loaded in the developer console.
Expert Guides on Using Images in WordPress
Now that you know how to use WebP images in WordPress, you may like to see some other guides for using images on your WordPress site:
- How to Properly Add Images in WordPress (Step by Step)
- How to Add Featured Images or Post Thumbnails in WordPress
- WebP vs. PNG vs. JPEG: The Best Image Format for WordPress
- How to Optimize Images for Web Performance Without Losing Quality
- Best WordPress Image Compression Plugins Compared
- Tools to Create Better Images for Your Blog Posts
- Great WordPress Plugins for Managing Images (Updated)
- Image Alt Text vs Image Title in WordPress – What’s the Difference?
- Where Does WordPress Store Images on Your Site?
- How to Easily Lazy Load Images in WordPress
We hope this article helped you learn how to use WebP images in WordPress. You may also want to see our guide on how to create an email newsletter and our expert picks for the best business phone services for your website.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Olaf
Whenever we face the question of how to speed up a website, media is one area where there’s almost always room for optimization. Practically every WordPress user, unless they’re a professional, uploads images to the site as they are saved on their computer, often unnecessarily large in both dimensions and file size. It’s interesting to see how much a website’s speed can improve just by adjusting media, specifically by compressing images into a different format. I like WebP because it still offers sufficient quality while keeping file sizes much smaller compared to the original. For existing websites with dozens of images, it’s useful to know a method to do this all in bulk, and that’s when tutorials like these are incredibly valuable.
Paul
I’ve followed the steps you laid out, but on testing, the new tab that opens when I select “Open image in new tab” does not end in webp, as you show, but as the original file extension. When I select “Save image as…,” however, it does show webp. I’m not entirely sure what this means. Is the image truly webp, and is it showing as such? The browser I’m using is the latest version of Chrome, so it shouldn’t be pulling the fallback image. I use a caching plugin, but cleared the cache before testing.
WPBeginner Support
You are using WebP images if that is what you see when saving. It would depend on the tool you are using but there is WebP redirection for the URL so you keep the URL but show the WebP version of the image to prevent 404 errors.
Admin
MOINUDDIN WAHEED
I was searching for some mechanism to convert my wordpress images to webp as I have seen a huge difference in the file size between a png and jpg images and webp images.
Having webp images will definitely help load the website faster. It will enhance the speed and performance of the website.
Thanks for the guide for converting existing wordpress images to webp format.
WPBeginner Support
You’re welcome, glad you found our guide helpful
Admin
Jiří Vaněk
Usually, I generate WebP images in an external editor. However, is it better practice to upload images in PNG format to the web and then generate them into WebP? I mean, is it better to have both formats for the browser to choose from or not? I’m concerned that someone might still be using an old browser that doesn’t support WebP, and then those images won’t display on my website for that user.
WPBeginner Support
If you specifically want a fallback image then allowing plugins to convert the images for you would be the best option. Creating the WebP images with an editor would be the recommended way to save space on your site.
Admin
Jiří Vaněk
Thank you for your response. I still have plenty of space on my FTP (100 GB), so based on your answer, I’ll rather use a plugin to have more image formats on the website, ensuring it works well even for older browsers that don’t support webp. I know there are very few such browsers left, but they still exist. Thanks for the advice.
emir
We used a few images from webp in WooCommerce, while backing up woocommerce on another server, the webp images were not transferred, we returned to jpeg format again.
WPBeginner Support
Thank you for sharing your experience with webp images. If you reach out to the support for your backup tool, there are normally snippets or other ways to fix that issue!
Admin
Ashikur Rahman
if i follow step 1 i would have old files in jpg/png format right? it will create a mess in upload folder. they have remove original file option, if i use that option. will it break my post images?
and most importantly what if i deactive/delete eww plugin will it also delete converted webp image also?
what should i do?
WPBeginner Support
The plugin currently keeps the old images for the browsers that do not support WebP images and would only create the WebP image if it is a better size than the jpg/png. Removing the original would not break your site but if a majority of your visitors are using older browsers that don’t support WebP it could be broken for those users.
You would need to check with the plugin’s support for the current status of the created images when the plugin is removed.
Admin
Rebecca
Hi I notice some plugins like wp-optimize allows an option to preserve exif data for webp conversion. Is this data necessary to keep?
Thanks in advance
WPBeginner Support
It is not required but is useful for the sites that use that information.
Admin
Theo
here’s what I’m looking for,
Very helpful
WPBeginner Support
Glad our guide was helpful!
Admin
Kim
Thanks so much for the quick reply!
WPBeginner Support
Glad we could help
Admin
Kim
This is a great tip, just 1 question…will I need to run the EWWW optimizer every time that I upload a new image (PNG, JPG) ?
WPBeginner Support
The plugin will automate the process for new uploads
Admin