WordPress has officially supported the WebP format since version 5.8 (released in 2021). This means that on a modern, standard WordPress installation, you should be able to upload WebP images to your Media Library without any issues. However, many users still encounter the error: "Sorry, this file type is not permitted for security reasons."
Here are the primary reasons this happens:
For most users, installing a plugin is the safest and easiest way to enable WebP support and handle image optimization automatically. These plugins not only allow you to upload WebP files but can also convert your existing JPG/PNG images to WebP and serve them to compatible browsers.
Plugin | Key Features | Best For |
---|---|---|
Imagify | Easy to use, one-click WebP conversion, serves WebP via `picture` tag or rewrite rules. Generous free tier. | Beginners and those who want an all-in-one solution. |
WebP Express | Highly configurable, multiple serving methods, completely free with no image limits. | Advanced users who want fine-grained control. |
ShortPixel | Excellent optimization, CDN integration, reliable WebP serving. | Users who also need a powerful image compression service. |
If you prefer not to add another plugin to your site, you can enable WebP uploads by adding a small snippet of code to your theme's `functions.php` file. This method tells WordPress that the WebP format is safe to upload.
function webp_upload_mimes($mimes) {
$mimes['webp'] = 'image/webp';
return $mimes;
}
add_filter('upload_mimes', 'webp_upload_mimes', 10, 1);
This code hooks into WordPress's `upload_mimes` filter and adds the WebP MIME type to the list of allowed files. You should now be able to upload WebP images directly to your Media Library.
Once you've enabled WebP uploads, you can start adding them to your site. Go to Media > Add New and try uploading a .webp
file. It should now upload without any errors.
Even if WordPress allows the upload, your server might not be able to generate thumbnails for WebP images. This depends on the image processing libraries (like GD or Imagick) installed on your web server. If thumbnails are not being created, you may need to contact your hosting provider and ask them to enable WebP support in their server's image library.
Just uploading WebP images isn't enough. You need to ensure that they are only served to browsers that support them (like Chrome, Firefox, Safari) while older browsers get the original JPG or PNG. This is called **content negotiation**.
The manual code snippet above does not handle this. It only allows you to upload the files. To properly serve WebP images, you really need a plugin like Imagify or WebP Express. They handle this complex logic for you, ensuring every visitor has a good experience.
This is almost always a server issue where the GD or Imagick library doesn't have WebP support enabled. A plugin like Imagify can often bypass this, but if you're using the manual method, you will need to contact your host.
For 99% of users, using a plugin is the better option. It's safer, easier, and handles the critical task of serving the correct image format to visitors. The code snippet is only for users who are comfortable editing theme files and understand that it only solves the upload issue, not the serving issue.
Yes, indirectly. WebP images are smaller, which makes your website load faster. Page speed is a confirmed Google ranking factor. A faster site leads to a better user experience, lower bounce rates, and can positively impact your SEO rankings.
Yes. Plugins like Imagify, ShortPixel, and WebP Express have bulk optimization features that can go through your existing library and create WebP versions of all your old images.
This is very rare. Themes display images using standard HTML. As long as you are using a plugin to serve the WebP images correctly (e.g., with a `picture` tag), it will work with any well-coded theme.
Before uploading to WordPress, convert your images to the efficient WebP format using our free tools.