Fix: WebP Not Supported in WordPress - Complete Guide 2025

Published on August 23, 2025 | Updated: August 23, 2025 | Reading time: 12 minutes
Quick Summary: If you can't upload WebP images to WordPress, it's because your server or WordPress version needs a little help. The easiest fix is to use a free plugin like Imagify or WebP Express. Alternatively, you can add a small code snippet to your theme's `functions.php` file to enable WebP uploads manually. This guide covers all methods.

Table of Contents

Why Does WordPress Sometimes Block WebP?

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:

Method 1: The Easy Way (Use a Plugin)

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.

Recommended Plugins

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.

Step-by-Step Guide using Imagify

1 Install and Activate: From your WordPress dashboard, go to Plugins > Add New, search for "Imagify", and click Install Now, then Activate.
2 Create an Account: You'll be prompted to create a free Imagify account to get an API key.
3 Configure Settings: Go to Settings > Imagify. Under the "Optimization" section, find the "WebP Format" options.
4 Enable WebP: Check the box for "Create WebP versions of images". Then, choose a serving method. Using the `picture` tag is the most compatible option.
5 Save Changes: Click Save Changes. Imagify will now allow WebP uploads and start converting new images to WebP automatically.
Plugin Advantage: Using a plugin is the recommended method because it not only fixes the upload issue but also handles the complex task of serving the correct image format to different browsers, which is crucial for site speed and compatibility.

Method 2: The Manual Way (Code Snippet)

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.

Warning: Editing your theme's files can break your site if done incorrectly. Always back up your `functions.php` file before making changes. It's highly recommended to use a child theme to avoid your changes being overwritten when you update your main theme.

Step-by-Step Guide

1 Access Your Theme Files: From your WordPress dashboard, go to Appearance > Theme File Editor. If you don't see this option, you'll need to access your files via FTP or your hosting provider's file manager.
2 Select `functions.php`: On the right side of the editor, find and click on the file named Theme Functions (functions.php).
3 Add the Code: Scroll to the bottom of the file and paste the following code snippet: function webp_upload_mimes($mimes) { $mimes['webp'] = 'image/webp'; return $mimes; } add_filter('upload_mimes', 'webp_upload_mimes', 10, 1);
4 Save the File: Click the Update File button.

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.

What to Do After Enabling WebP Support

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.

Important Consideration: Thumbnails

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.

Serving WebP Images to Visitors

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.

Troubleshooting Common Issues

Problem: I added the code, but I still get the security error.

Problem: I can upload WebP, but the images appear broken in the Media Library.

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.

Frequently Asked Questions

Is it better to use a plugin or the code snippet?

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.

Will using WebP images improve my SEO?

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.

Can I convert my entire existing Media Library to WebP?

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.

What if my theme doesn't support WebP?

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.

Final Takeaway: Fixing WebP support in WordPress is a simple process. Use a dedicated plugin for an easy, all-in-one solution, or add a simple code snippet if you only need to enable uploads and are comfortable editing theme files.

Need to Convert Your Images to WebP?

Before uploading to WordPress, convert your images to the efficient WebP format using our free tools.

WebP Image Transparency Issues