Next-Gen Image Formats WordPress - Serve WebP and AVIF the Right Way (2026)
WebP and AVIF images are usually much smaller than JPEG and PNG at similar quality. Switching to them is one of the most reliable ways to speed up image-heavy WordPress pages.
What "Next-Gen Formats" Means
Older formats like JPEG and PNG have been around for decades. Newer formats compress images more efficiently, so the same picture takes fewer bytes.
- WebP: widely supported in modern browsers, with lossy and lossless modes and transparency.
- AVIF: newer, often smaller than WebP at similar quality, now supported by modern browsers, though encoding is slower.
PageSpeed Insights used to flag this as "Serve images in next-gen formats". In Lighthouse 13, it's part of the Improve image delivery insight, which also covers images that are too large for how they're displayed.
WebP vs AVIF vs JPEG
| JPEG | PNG | WebP | AVIF | |
|---|---|---|---|---|
| Best for | Photos | Graphics, transparency | Photos and graphics | Photos and graphics |
| Typical file size | Baseline | Large for photos | Smaller than JPEG | Often smallest |
| Transparency | No | Yes | Yes | Yes |
| Browser support | Universal | Universal | Modern browsers | Modern browsers |
| Encoding speed | Fast | Fast | Fast | Slower |
| WordPress upload support | Yes | Yes | Since 5.8 | Since 6.5, if the server supports it |
Exact savings depend on the image and quality settings, so test with your own images.
How WordPress Supports Modern Formats
WordPress can accept WebP uploads since version 5.8 and AVIF since version 6.5, provided your server's image library supports them. When you upload a WebP or AVIF, WordPress creates its usual resized versions in the same format.
WordPress doesn't convert existing JPEGs and PNGs on its own. For that, you need a plugin or a CDN that converts images.
Ways to Convert and Serve Next-Gen Images
| Method | How It Works | Pros | Cons |
|---|---|---|---|
| Convert before upload | Save images as WebP or AVIF on your computer | No plugin needed | Manual; doesn't fix existing images |
| Image optimization plugin | Converts library images and serves them to supported browsers | Handles existing images; automatic | Adds a plugin; some use paid quotas |
| Modern Image Formats plugin | WordPress Performance Team plugin that converts uploads | Lightweight, from the core team | Focuses on new uploads |
| Image CDN | Converts and resizes on the fly | No local storage; responsive sizes | Ongoing cost; relies on a service |
How Converted Images Are Served
Plugins serve WebP or AVIF in one of two main ways:
- Picture elements: the HTML lists the modern format first and a JPEG fallback, so each browser picks what it supports.
- Server rewrite rules: the server sends the WebP version when the browser says it accepts it, keeping the same URL.
Both work. Rewrite rules can conflict with caching if the cache doesn't vary by browser support, which is why WP Rocket offers a WebP Compatibility add-on that coordinates with image plugins.
Using Next-Gen Images With WP Rocket
WP Rocket doesn't convert images itself. It works with image optimization plugins that do, including Imagify, from the same company. Its WebP Compatibility add-on makes sure cached pages serve WebP correctly when your image plugin uses the picture-element approach.
A recent WP Rocket release also stopped serving WebP files that are larger than the original image, which can happen with some graphics.
Choose an image plugin
Pick one that converts to WebP, and AVIF if you want it.
Convert your library
Run bulk conversion for existing images.
Choose a serving method
Picture elements are the most cache-friendly with WP Rocket.
Enable WebP compatibility if needed
In WP Rocket's add-ons, when your image plugin relies on it.
Clear caches and test
Check in the Network panel that images load as WebP or AVIF.
See best image optimization plugins.
Common Problems When Switching Formats
Images not served as WebP
The cache was built before conversion. Clear the page cache and CDN cache.
Some browsers get broken images
The fallback isn't set up. Use picture elements or ensure the plugin keeps originals.
Background images still JPEG
CSS background images aren't converted by many plugins. Convert those files manually or use a plugin that handles CSS.
WebP larger than JPEG
Happens with some graphics. Keep the smaller original; some tools do this automatically.
CDN serves the wrong format
The CDN cache needs to vary by browser support, or use URLs that differ by format.
Quality Settings
Compression level matters as much as format. Most tools let you choose lossy, glossy or lossless modes. For photos, a moderate lossy setting usually gives big savings with no visible difference. For logos, screenshots and graphics with text, lossless or higher quality settings avoid blurry edges.
Check a few representative images side by side before converting your whole library.
Don't Forget Sizing
Next-gen formats reduce bytes per pixel, but serving a 3,000-pixel image in a 600-pixel space still wastes bandwidth. Make sure:
- Originals aren't larger than you'll ever display.
- Your theme uses responsive image sizes so browsers can pick a smaller file.
- Hero images are sized for mobile and desktop.
See optimizing images.
A Worked Example
A photography portfolio serves large JPEGs and fails LCP on mobile. Converting the library to WebP with AVIF where supported, and capping originals at a sensible width, cuts image weight on gallery pages dramatically. The hero image on the homepage, now an AVIF with the right dimensions for mobile, loads much sooner, and LCP passes.
Next-Gen Image Formats WordPress FAQ
What are next-gen image formats?
Modern formats like WebP and AVIF that compress images more efficiently than JPEG and PNG.
Does WordPress support WebP and AVIF?
Yes for uploads: WebP since 5.8 and AVIF since 6.5, if your server supports them. Converting existing images needs a plugin or CDN.
Should I use WebP or AVIF?
WebP is the safe default. AVIF is often smaller and is supported by modern browsers; serve it with a fallback.
Does WP Rocket convert images to WebP?
No. It works with image optimization plugins that convert images, and has a WebP Compatibility add-on.