How To Upload webP images in WordPress (With/Without Plugin) 2021

Disclosure! My posts may contain affiliate links, which means that, if you choose to make a purchase, I may earn a small commission at no extra cost to you. I greatly appreciate your support! Learn more

Are you worried about how to upload WebP images in WordPress and how to convert your JPG and PNG images files to WebP files? Then you are in the right place, Today I will give you a solution to these problems. After reading this article you will be able to upload WebP images in WordPress website without installing any plugin. I will also share some useful WordPress plugin using which you can upload webp images in WordPress website very easily.

Recently, Google has introduced a new image file format called WebP. WebP is a next-generation image file format, It compresses image files up to 35% smaller in size without losing any quality. Google recommends to use this file format to increase your website speed, But the problem is we are unable to up-load webp image file to WordPress and many of us are using WordPress. Here is the solution to upload webp image file to WordPress.

By default uploading webp images file format in WordPress is not enabled yet, so WordPress will show you a security error. And you can upload webp images in WordPress very easily by enabling it on your website using a plugin or some code. In this article I will share both plugin 7 & code, you can use as your wish, I prefer to use code than a plugin.

What is WebP image Format

WebP is an image file format that contains both lossless and lossy compression. This is a next-generation image format and it was developed by Google. Using WebP format image, webmasters and web developers can create smaller, richer images that make the website faster.

WebP image format file compresses images to 26% smaller in size compared to PNG and 25-34% smaller in size as compared to JPEG image format. This image file format is capable of reducing image file size up to 34% smaller in size retaining high-quality. WebP also supports transparency at just 22% additional byte.

Google regularly takes the change in its algorithm to provide the best experience to its users. Google was working on a new image format language past years and has released its stable in 2019. Images play a big role in website speed so Google has developed a new image format that will help developers to increase their website speed. If you are a developer then you should use this new image format to get a better result in Ranking.

How WebP Works

Lossy WebP compression uses predictive coding to encode an image, the same method used by the VP8 video codec to compress keyframes in videos. Predictive coding uses the values in neighbouring blocks of pixels to predict the values in a block and then encodes only the difference.

Lossless WebP compression uses already seen image fragments in order to exactly reconstruct new pixels. It can also use a local palette if no interesting match is found.

Source-: Google Developer

Benefits Of Using WebP Format Image

There are many benefits of using WebP format image file on your Website/blog. I love to use this format image file on my blog, you may start using it soon. And also the proprietary PageSpeed Insights tool suggests that webmaster switch from JPEG and PNG to WebP to improve their website speed score. some benefits of using WebP are listed here. Always use WebP image format on your website for better speed.

  • WebP format image files are 34% smaller in size as compared to PNG or JPG in the same dimension and high-quality.
  • WebP can serve in small bytes, your images load faster which will increase website speed.
  • Serving Quality image in small byte means saving your bandwidth in a smarter way

Which Browser Supports WebP File

The webP image format is supported in Google Chrome, Mozilla Firefox, Microsoft Edge, Opera, and many other browsers. This file format includes the lightweight encoding and decoding library libwebp and the command line tools cwebp and dwebp for converting images to and from webp format. Currently, webP image file format is not supported by Apple’s Safari browser.

WebP Image File Format Details

This webp image format was developed by Google, The format was first announced on 30 September 2010 as a new open standard for lossy compressed true-colour graphics on the web, producing smaller files of comparable image quality to the JPG, JPEG, PNG scheme.

File Extension.webp
Media Typeimage/webp
Type of FormatImage format
Written inC
PlatformCross-platform
LicenseBSD license
Open Format?Yes
Developed byGoogle
Initial Release30 September 2010
Stable Release1.0.3 – 4th July 2019

Also Read: How To Remove date from Blogger Post URL

How To Upload WebP Images in WordPress

When you try to upload WebP image file format to your WordPress website, It shows you an error message ”Sorry, this file type is not permitted for security reasons”. If you have tried to upload a WebP file to your WordPress media library and you receive the error message “Sorry, this file type is not permitted for security reasons“, I will explain here, how to upload webp image files in your WordPress website. If you face any problem you can watch this video in which I have practically shown how you can upload webp images in WordPress.

WordPress shows you this error because WordPress does not natively support viewing and uploading WebP files, your hosting provider doesn’t recognise this file type so they don’t allow you to upload. First, you have to inform your hosting provider about this file.

How about directly uploading WebP images to WordPress? It’s very easy, you have to add some code on your theme functions.php file, Just follow these steps below

6 Easy Steps To Upload Webp image files in WordPress without plugin

By default WordPress does not allow you to upload webp image files, if you want to upload webp image files to WordPress then follow these 6 easy steps below to upload webp images to WordPress.

  1. Log in to your WordPress admin area
  2. Appearance
  3. Theme Editor
  4. Theme Functions [ functions.php]
  5. Copy and Paste this below-given Code and click on update file
  6. You are done, now you will be upload WebP files to your WordPress website
How To upload WebP format image to wordpress

Add this below-given code to your theme functions (functions.php)

function webp_upload_mimes( $existing_mimes ) {
	// add webp to the list of mime types
	$existing_mimes['webp'] = 'image/webp';

	// return the array back to the function with our added mime type
	return $existing_mimes;
}
add_filter( 'mime_types', 'webp_upload_mimes' );

After adding this code you will be upload WebP images in your WordPress but you can’t preview these images on your media library. If you want to see an image preview of these files on your media library you have to add some extra code to your Theme Functions (functions.php) of your WordPress Theme, The code is given below.

Add the below-given code to your theme functions (functions.php) to preview webp images on your media library

//** * Enable preview / thumbnail for webp image files.*/
function webp_is_displayable($result, $path) {
    if ($result === false) {
        $displayable_image_types = array( IMAGETYPE_WEBP );
        $info = @getimagesize( $path );

        if (empty($info)) {
            $result = false;
        } elseif (!in_array($info[2], $displayable_image_types)) {
            $result = false;
        } else {
            $result = true;
        }
    }

    return $result;
}
add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);

Upload WebP images in WordPress using Plugin

You can also upload webp images to your wordpress website by the help of a plugin. Go to your WordPress plugin library and search “Allow webp image” and install a plugin, many plugin s are available so choose a good webp plugin. After installing and activating this plugin you will be able to upload webp image files to WordPress website.

webp image converter plugin

Some WordPress plugins are also available will convert your existing images (on media library) to webp format very quickly.

How To Convert JPG and PNG To WebP Format

I think I have solved your query, how to upload webp images in WordPress. WebP image file format is natively supported by Chrome, Edge, Firefox and many other web browsers. Here I will share with you how to convert a JPG or PNG format image to WebP format, to do that you have to use some converter softwares. If you want to convert your images to WebP format online for free, then you can visit some website they provide online image converter for free. I have listed some website name that I use to convert my images, you may use these websites or others to convert your images.

How WebP Images Will Impact Your Website SEO?

In this article, I have explained to you how to upload webp images in WordPress and how to convert an image file to webp file. You should know what is the profit of using webp image file on our website, definitely, there are many profits of using this new image file format. Firstly, this is a next-generation image file format and this is developed by Google. PageSpeed Insight also recommends using this image file type, After using this images file type your website speed will increase definitely which will help you in the Google ranking.

I hope this article was helpful for you to upload webp images in WordPress, please do share this on Facebook and Twitter so others can also serve webp image files others website. If you have any doubt, query, suggestions you can share with us on our Facebook group and Telegram group.

Should I use webP images on WordPress website

Yes, definitely you can use webp image format on your website which will increase your website speed, Pageinsight also recommend to serve images on webp format.

What are the disadvantages of using webP images on WordPress

Webp image format is good to increase website speed but it has also some disadvantages. Till now in 2021 webp image file format is not supported by Twitter and Safari browser which may be a disadvantage for some users.

Hey, I am Keshab Chandra Behera an Indian Blogger, Affiliate Marketer and YouTube Personality based in Bhubaneswar, Odisha, India.

Leave a Comment