WebP or AVIF for your WordPress images? In most cases, WebP remains the simplest and safest choice. AVIF can, however, further reduce the size of some images, especially detailed photos. The right choice therefore depends on your hosting, your visitors, and the method used to deliver a fallback image.
Both modern formats are advantageous replacements for many uses of JPEG and PNG. They support lossy compression, transparency and, depending on the format, animation. However, a smaller file isn’t enough: the image must also display correctly and WordPress must be able to generate its intermediate sizes.
Short answer: start with WebP, then evaluate AVIF
Choose WebP if you want to modernize your media library with minimal compatibility risk. WordPress has supported WebP since version 5.8. Official documentation also notes that WebP can offer lossy or lossless compression and that its files are generally smaller than equivalent JPEG or PNG files.
Choose AVIF if your environment truly supports it and if you’ve validated the rendering on your important pages. WordPress has supported AVIF files since version 6.5, provided the hosting image-processing library can handle them. AVIF targets very efficient compression while preserving good perceived quality, particularly for detailed photographs.
In other words, WebP is often the best starting point. AVIF becomes an excellent second choice when you have a reliable fallback strategy and measurements that show a real gain on your site.
WebP and AVIF: the differences that matter in WordPress
| Criteria | WebP | AVIF |
|---|---|---|
| Support in WordPress | Native since WordPress 5.8 | Native since WordPress 6.5, depending on hosting support |
| Conservative choice for an existing site | Yes, in most cases | Yes, after technical verification and testing |
| Potential size | Often much smaller than traditional formats in many cases | Can further reduce the size of certain photos |
| Preparation time | Usually simpler to integrate | Requires more validation of processing and delivery |
| Fallback image | Desirable for older browsers or external services | Particularly important if your audience uses older devices |
WebP: the easiest modern format to adopt
WebP works well for photos, illustrations and images with transparency. It’s also supported by the GD and ImageMagick libraries for static images, while animated images require special handling. See the WordPress documentation on images in themes for details of that support.
Its main advantage is practical: you can use it in WordPress without forcing a complete overhaul of your media management. If you convert existing images, though, keep the originals. They’re still useful for editing an image, recreating image sizes or providing a compatible format elsewhere.
AVIF: higher potential, but confirm on your site first
AVIF is built around the AV1 codec. It can deliver very efficient files while preserving a lot of visual detail. It also supports transparency and a wide color gamut. The AVIF overview on web.dev notes, however, that any new format requires thinking about compatibility and fallbacks.
In WordPress, uploading an AVIF file doesn’t guarantee your server can resize it, crop it or create all required sizes. Check the «Media Handling» section in the Site Health info. It will show whether AVIF is listed among the formats recognized by the environment.
This check is essential before replacing your primary images. If processing fails, you may end up with missing sizes or inconsistent rendering in some blocks, themes or plugins.
Compatibility goes beyond browsers
You need to distinguish two things: a browser’s ability to display the format and your installation’s ability to produce and serve it. A browser that doesn’t understand AVIF can’t display that file. It must receive another source, often a WebP or a JPEG.
WordPress has accepted and used AVIF files as media since version 6.5. However, core WordPress doesn’t automatically choose a different file based on the browser’s capabilities. The WordPress team notes that advanced conditional delivery features, where each visitor receives the best available format, aren’t part of this basic support. See the technical note on the arrival of AVIF in WordPress 6.5 before planning a migration.
An optimization plugin, a CDN or a host configuration can handle that selection. The important thing is to verify its actual behavior: AVIF for compatible browsers, WebP when needed, then JPEG or PNG as the final fallback. Don’t assume an automatic conversion creates that complete path.
Which strategy to choose for your situation?
You want to quickly improve images on a brochure site
Adopt WebP as your primary modern format. Keep the original JPEG or PNG files when your solution uses them as fallbacks. This approach reduces complexity and makes troubleshooting easier if an image doesn’t display as expected.
Before converting a large batch, also check the dimensions and file sizes of your source images. An image that’s far too large will remain costly, even in a good format. To choose a tool suited to compression, conversion or regeneration, see this guide to WordPress plugins for managing images.
You publish a lot of editorial or product photos
Test AVIF on a representative sample. Include dark photos, gradients, fine textures, visuals containing text and images with transparency. Compare file sizes, but also examine detail at the actual displayed sizes on mobile and desktop.
Then measure your pages with the same images in each format. A useful weight reduction should improve transfer without producing distracting artifacts. Also check your product pages, featured images and social shares, since some external services have their own format constraints.
Your audience includes older devices or browsers
Favor a fallback delivery rather than fully replacing originals with AVIF. The HTML element picture specifically allows offering a modern source and a compatible solution. web.dev demonstrates this principle with AVIF and a fallback JPEG image in its guide on serving AVIF images.
You don’t have to manually change every block, though. A properly configured solution can handle that. However, test public pages in multiple browsers and on a real phone before processing the entire media library.
A simple decision method
- Check that WordPress and your hosting can handle the intended format.
- Keep a usable copy of your original files.
- Prepare a few representative images in WebP and AVIF.
- Compare file size and rendering at the dimensions used on your pages.
- Validate behavior on mobile, desktop, and different browsers.
- Confirm that a fallback exists for browsers and services that don’t support the modern format.
- Roll out gradually, then monitor the most visited pages.
If a modern file won’t upload or WordPress doesn’t create the expected sizes, don’t force the migration. Instead, go through the useful checks when an image won’t upload to WordPress to isolate the format, server limits, or a plugin conflict.
The recommended choice
For most sites, use WebP as a reliable baseline. It already offers a noticeable improvement over older formats and integrates easily into a WordPress workflow.
Use AVIF when your hosting supports it, your tests confirm a visible or measurable benefit, and a fallback image protects visitors who can’t view it. This combination lets you pursue performance without sacrificing the reliability of your visual content.









