How To Upload webP images in WordPress

How To Upload webP images in WordPress :Are you worried about how to upload WebP images to WordPress and convert your JPG and PNG image files to WebP files? So you are at right place, today I will tell you the solution of these problems.

After reading this article (How To Upload WebP Images In WordPress) you will be able to upload WebP images to 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 shrinks image files up to 35% in size without losing any quality.

How To Upload webP images in WordPress : Google recommends using this file format to increase the speed of your website, but the problem is that we are unable to upload the WebP image file to WordPress and many of us are using WordPress. Here is the solution for uploading webapp image files to WordPress.

How To Upload webP images in WordPress
How To Upload WebP Images In WordPress

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

what is webp image format


WebP is an image file format that includes both lossless and lossy compression. It is a next generation image format and was developed by Google. By using the WebP format image, webmasters and web developers can create small, rich images that make a website faster.

The WebP image format file makes images 26% smaller in size than PNG and 25-34% smaller in size than the JPEG image format. This image file format is capable of reducing image file size by up to 34% while maintaining high quality. WebP also supports transparency at only 22% additional bytes.

Google regularly changes its algorithms to provide the best experience to its users. Google was working on a new image format language in the past years and has released it stable in 2019.

Images play a big role in website speed so Google has developed a new image format which will help developers to increase their website speed. If you are a developer then you should use this new image format to get better results in ranking.

How WebP Works


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

Lossless WebP compression uses previously observed image fragments to properly reconstruct new pixels. It can also use the local palette if no interesting matches are found.

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 can start using it soon. And the proprietary PageSpeed ​​Insights tool even suggests webmasters switch from JPEG and PNG to WebP to improve their website speed scores. Some of the 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 compared to PNG or JPG of the same dimensions and high quality.


WebP can work in smaller bytes, your images load faster which will increase website speed.
Offering quality images in smaller bytes means better saving your bandwidth
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 the webp format. Currently, the webP image file format is not supported by Apple’s Safari browser.

webp image file format description


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-color graphics on the web, comparable to the JPG, JPEG, PNG scheme. Produces smaller files of image quality.

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
How To Upload WebP Images In WordPress

How to Upload WebP Images to 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 allowed for security reasons”.

If you tried to upload a WebP file to your WordPress media library and you receive the error message “Sorry, this file type is not allowed for security reasons”, then I will explain here how to add a WebP image to your WordPress website. How to upload files If you face any problem then you can watch this video in which I have shown practically how you can upload web image in WordPress.

WordPress shows you this error because WordPress does not natively support viewing and uploading of WebP files, Webmasters your hosting provider does not recognize this file type, so they do not allow you to upload. First, you need to inform your hosting provider about this file.

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

6 Simple Steps to Upload WebP Image Files to WordPress Without a Plugin


WordPress by default 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 given below to upload webp images to WordPress.

How To Upload WebP Images In WordPress
How To Upload WebP Images In WordPress

Log in to your WordPress admin area
appearance
theme editor
Theme Functions [functions.php]
copy and paste this code below and click on update file

You are done, now you will upload the webp file to your WordPress website

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’ );

How To Upload WebP Images In WordPress
How To Upload WebP Images In WordPress

After adding this code you will upload webpi images in your wordpress but you cannot preview these images on your media library. If you want to see an image preview of these files on your media library, you will need to add some additional code to the 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 to WordPress Using Plugin


Upload WebP Images to WordPress Using Plugin : You can also upload WebP images to your WordPress website with the help of a plugin. Go to your wordpress plugin library and search “allow webp image” and install a plugin, there are many plugins available so choose a good webp plugin. After installing and activating this plugin, you will be able to upload WebP image files to the WordPress website.

How To Upload WebP Images In WordPress
How To Upload WebP Images In WordPress , use webP images on WordPress

There are also some WordPress plugins available that will convert your existing images (on the media library) to the WebP format very quickly.

How to Convert JPG and PNG to WebP Format


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

https://image.online-convert.com/convert-to-webp
https://webp-converter.com/
https://convertio.co/png-webp/
https://www.ps2pdf.com/convert-png-to-webp
https://www.zamzar.com/convert/png-to-webp/


How WebP Images Will Affect Your Website SEO?


In this article, I have explained to you how to upload webp images in WordPress and convert image files to webp files. You should know what are the benefits of using webp image file on our website, of course, there are many advantages to using this new image file format.

Firstly, it is a next generation image file format and is developed by Google. PageSpeed ​​Insight also recommends to use this image file type, your website speed will definitely increase after using this image file type which will help you in Google ranking.

I hope this article was helpful for you on how to upload webp image in wordpress, please share it on facebook and twitter so that others can offer webp image files to other website too. How To Upload WebP Images In WordPress If you have any doubt, query, suggestion then you can share with us on our facebook group and telegram group.

Should I Use WebP Images on a WordPress Website?


Yes, of course 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 for increasing website speed but it also has some disadvantages. As of now in 2021 webp image file format is not supported by Twitter and Safari browser which may be a disadvantage for some users.