WP-Optimize Releases WebP Image Compression Feature

Automatic conversion of JPEG and PNG to WebP images

The latest version of WP-Optimize now features the option to automatically convert and compress images using the WebP image format. This optimized image format helps to ensure a fast, efficient page speed and positive user experience.


WebP images are up to 26% smaller compared to PNG

WebP images are a more modern alternative to JPEG and PNG images that provide superior lossless and lossy compression for website imagery. Through the use of WebP, images are rich and high in quality, but file sizes are smaller, up to 26% smaller when compared to PNG images. This results in a faster website, which has lots of benefits for SEO and user experience. Google recommends using WebP images for all your website imagery.

Previously, the WebP version of an image was only served if the image had already been compressed and converted within WP-Optimize.

Images are now converted automatically and served on-the-fly to web visitors

However, thanks to our On-The-Fly WebP update, that is no longer the case. Now, when a visitor comes to the site, WP-Optimize dynamically generates the WebP version of your site’s images and serves that instead. This process occurs for the first visitor only – subsequent visitors are directly served the WebP version of the image, leading to a faster, more efficient site and an improved user experience.

Notes and important information:

Compatibility and Server Requirements
This new feature only works on Apache/LiteSpeed servers, if all the required Apache modules are enabled by your hosting server.
Disabling the “On-the-Fly WebP Conversion” Feature
By default, if the WebP feature is enabled, the “On-the-Fly WebP Conversion” feature is also enabled. Most users will benefit from this feature, so we haven’t provided an option to disable it on the settings panel. If you still want to disable it, just add the following line to your website’s wp-config.php file:

define( ‘WPO_DISABLE_WEBP_ON_DEMAND’, true );
How to Verify if the Feature is Working
To check if the feature is working, navigate to the wp-content/uploads/ directory using FTP. If you do not see an .htaccess file, it means the feature is not working. If you see an .htaccess file, open it and check for the following code:

# BEGIN WP-Optimize WebP Rules

<IfModule mod_rewrite.c>


# Redirect images to webp-on-demand.php (if browser supports webp)

RewriteCond %{HTTP_ACCEPT} image/webp

RewriteCond %{REQUEST_FILENAME} -f

RewriteCond %{REQUEST_FILENAME} (?i)(.*)(\.jpe?g|\.png)$

RewriteRule (?i).*$ /wp-content/plugins/wp-optimize-premium/webp/webp-on-demand.php



# END WP-Optimize WebP Rules

If you find this code, the feature is working correctly.

Fast, efficient, optimized website performance

WP-Optimize helps you to boost the performance of your WordPress website. It will shrink your database size, compress large images, clean up spam and unapproved comments, report on database tables with overhead and wasted space, and cache your site. The result is a leaner, faster, more organised website. Our Premium version features enhanced functionality, including multisite support, sophisticated scheduling options, and is compatible with campaign tracking queries like UTM tags If you think WP-Optimize could be the right solution for your website, you can learn more.

How to optimize WordPress images with WP-Optimize

Post updated: 7th February 2023

Websites can accumulate hundreds, if not thousands of images over time. Images in their original uncompressed format can slow your website down, impacting user experience, bounce rate, and SEO performance. 

This article outlines how to improve the speed of your site by optimizing images using WP-Optimize.

WP-Optimize ‘Free’ or Premium?

Image compression is included in both packages but when it comes to page load speed and SEO, every little bit helps.

Premium features includes ‘Lazy load’, which loads only parts of a web page that are visible to the user, allowing a page to load much faster. Additional benefits of Premium include multi-site support, scheduling so you can ‘set and forget’ and premium support. You can find out about the benefits of WP-Optimize Premium here.

How to optimize your images

Step 1

Once you have installed the WP-Optimize plugin, go to WP-Optimize > Images in your WordPress dashboard. Now you can decide what level of compression you want for your images. There are three options:

  • Prioritize maximum compression 
  • Prioritize retention of detail 
  • Custom

You’ll save the most space by selecting “Prioritize maximum compression“. This compresses your images, making them smaller and quicker to load, and as a result, your WordPress site will load faster. However, if you run a wedding photography website, for example, you may not want to compress your images fully, as there can be a slight drop in image quality the more an image is compressed. While the loss in quality is hardly noticeable for most people and is not a consideration for most websites, if high-end quality images are essential to you, then you should select “Prioritize retention of detail“. This option will still reduce the image file size (though not as much as ‘maximum compression’) but will maintain the high quality of the original image. You can also select “custom“, if you would like to format your images to a level that is not quite maximum compression or best image quality. 

Step 2

image optimization screenshot

Below the settings options, you will see all the Uncompressed images uploaded to your website. Here, you can manually select individual images you wish to compress or press the “Select All” button if you want to compress all the images to the same level. As previously mentioned, if you have high-quality images that you do not wish to fully compress alongside other images that may not be as important, you can individually select them and run a ‘maximum retention of detail’ compression. You can then run the ‘maximum compression’ option on the remaining images.

Step 3

WP-Optimize also gives you ‘advanced options‘ when compressing your images. Here you can choose options such as: 

  • Preserve EXIF data – Handy for professional photographers that may require the EXIF data at a future date.
  • Backup original images – Don’t worry if you make a mistake or want to revert to the original image. WP-Optimize gives you the option to retain a backup.
  • Automatically delete image backups – Once you have compressed your images, you can set a date for when you want your backup images deleted. This helps prevent your site from storing large original files that are no longer needed. 
  • Delete all backup images now – If you are happy with the results and want to delete all your backed-up images, press this button, and WP-Optimize will do the rest. 
  • Mark all images as uncompressed – Use this option if you want to compress your images again or make further changes.
  • Restore all compressed images – If you decide that you no longer want your images compressed or have made a mistake and still have the original in your media library, you can restore all of your compressed images to their original state.

image optimization screenshot

Step 4

Once you have set up and decided what kind of image compression you are happy with, you can tick the “Automatically compress newly-added images” button so that you do not have to go through the process every time you upload a new image. Once you activate this option, every new image you upload will be compressed according to your chosen settings (compression or detail). 

If you would like to read more information on the benefits of compression versus detail, check out the following blog that goes into more detail and explains the benefits of both: Lossy vs Lossless image compression – A guide to the trade-off between image size and quality.

We have also put together a video of how to optimize your images:


A version of this article was initially posted on the UpdraftPlus blog as “How to use WP-Optimize image compression.”