Enable WebP in WordPress

Enable WebP in Wordpress

What is WebP

According to google

WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster.

WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index.

Lossless WebP supports transparency (also known as alpha channel) at a cost of just 22% additional bytes. For cases when lossy RGB compression is acceptable, lossy WebP also supports transparency, typically providing 3× smaller file sizes compared to PNG.

WordPress in stock format not letting you ro upload .webp files, If you try to upload webp files you will land in an error display like this

Sorry, this file type is not permitted for security reasons.

Solution

To enable .WebP inside your WordPress Installation , there is a simple tweak. Just go to

Appearance > Theme Editor > Functions.php

Add this to end of file

// Enable   webp image  format
function webp_upload_mimes($existing_mimes) {
$existing_mimes[‘webp’] = ‘image/webp’;
return $existing_mimes;
}
add_filter(‘mime_types’, ‘webp_upload_mimes’);

Save File and Exit, you are ready for the go , here are some sites for image conversion of PNG,JPG in to WebP

you may find more on google search 


Avatar

Interoons aim at providing electronically intelligent and comprehensive range of digital marketing solutions that exceed customer expectations. We implement revolutionary digital marketing ideas to achieve a common as well as the aggregate growth of the organization. Long-term customer relations and extended support are maintained.

Leave a Reply

Your email address will not be published. Required fields are marked *