Serving WebP images with WordPress 5.8 or greater

Serving WebP images with WordPress 5.8 or greater

WebP is a format created by Google that can be used on your site in place of more traditional image types such .jpg's and .png files. The files are smaller and therefore load much faster.

As of WordPress 5.8 WebP is supported as standard. Previous versions of WordPress needed a plugin to support WebP.

WordPress will not convert existing images. You'll still need a plug to convert them first. More details can be found on WordPress.org.

How it works

Enabling this feature automatically serves WebP images to supported browsers in place of PNG or JPG files.

What does it do?

Toggling on the WebP support for WordPress option in the platform makes some adjustments to the sites NGINX config as detailed below:

location ~* ^(/wp-content/.+).(png|jpg)$ {
set $base $1;
set $webp_uri $base$webp_suffix;
set $root /sites/storm/websitename/public;
root $root;
add_header Vary Accept;
try_files $webp_uri $uri =404;
}