Back to blog

WordPress Image Optimization in 2026: AVIF, WebP, and What Actually Moves the Needle

AVIF and WebP both work in WordPress now, but format choice is rarely the bottleneck. Here's what actually makes image-heavy pages fast.

WordPress Image Optimization in 2026: AVIF, WebP, and What Actually Moves the Needle

Most WordPress image optimization advice starts and ends with format conversion: switch to WebP, or now AVIF, and your site gets fast. Format matters, but it's usually not the largest win available, and on plenty of sites it isn't even in the top three. A page that serves a perfectly compressed 2400-pixel-wide AVIF into a 400-pixel-wide slot on a phone is still wasting most of that download.

WordPress core handles more of this than people assume, and it deliberately does not handle some things people assume it does. This covers what's actually built in as of 2026, how AVIF and WebP genuinely compare, and where the real performance gains hide.

TL;DR

  • WordPress core has supported WebP uploads since 5.8 and AVIF uploads since 6.5, but it does not automatically convert your JPEGs to either format. That feature was proposed for 6.1 and deliberately reverted; conversion still requires a plugin.
  • AVIF generally compresses harder than WebP, and WordPress's own announcement cites AVIF files up to 50% smaller than JPEG at comparable quality. But AVIF encoding is slower, and server support depends on your host's Imagick or LibGD build.
  • The bigger wins for most sites are correct sizing (srcset/sizes), not shipping oversized originals, lazy-loading everything below the fold while explicitly not lazy-loading your LCP image, and caching. Core already does much of this automatically.
  • Check Tools → Site Health → Info → Media Handling to see which formats your server can actually process before you plan around AVIF.
  • Format conversion helps most on image-heavy pages (galleries, WooCommerce catalogs). On a text-heavy blog post with two images, fixing sizing and caching will beat fixing format nearly every time.

What WordPress Core Already Does

Before adding a single plugin, it's worth knowing what you're already getting. Core's image handling has quietly become fairly capable.

Responsive images. Since WordPress 4.4, core generates srcset and sizes attributes automatically for images inserted through the media library. Rather than deciding server-side which size a visitor should get, WordPress sends the full list of available sizes to the browser and lets the browser pick based on viewport width and device pixel ratio. Core also registers a medium_large intermediate size at 768 pixels wide specifically to give responsive layouts a better midpoint to choose from, and caps the largest image included in srcset at 2048 pixels by default via the max_srcset_image_width filter.

Lazy loading and fetch priority. Core adds lazy loading and fetch priority hints to images automatically, so images below the fold defer their download until the browser needs them, and the browser gets a signal about which image matters most for initial render.

WebP and AVIF uploads. WordPress 5.8 added WebP support. WordPress 6.5 added AVIF support. In both cases that means you can upload files in those formats and WordPress treats them like any other image: it generates the thumbnail sizes, wires up responsive images, and serves them normally.

What core does not do: automatically convert your uploaded JPEGs into WebP or AVIF. This is the single most common misconception, and it has a specific history worth knowing.

The JPEG-to-WebP Conversion That Never Shipped

In 2022, the WordPress performance team proposed making core automatically generate WebP versions of uploaded JPEGs and serve those instead. It was merged toward WordPress 6.1 and then reverted before release. Matt Mullenweg's stated objection was that he was happy for WebP and HEIC support to stay in core, "but not with the change to convert everything to webp when JPEGs are uploaded." The concerns raised included operating-system and software compatibility with WebP files, the scope of a change that would touch every image in every media library, and pushing a major default before the surrounding ecosystem had matured.

The work moved to the performance team's Performance Lab feature plugin instead, where format conversion could develop as an opt-in rather than a default.

The practical takeaway for 2026: if you want automatic format conversion in WordPress, you install something to do it. Core will happily serve AVIF and WebP, but it will not create them from your existing JPEGs on its own.

AVIF vs. WebP: The Honest Comparison

Both are modern formats that beat JPEG and PNG on compression. The differences that actually matter in practice:

WebP AVIF
WordPress core support Since 5.8 Since 6.5
Typical size vs. JPEG Meaningfully smaller Smaller still; WordPress cites up to 50% reduction at comparable quality
Browser support Very broad, longer track record Supported in major browsers, newer arrival
Encoding speed Fast Noticeably slower, especially at high quality settings
Server requirement Widely available Requires Imagick or LibGD built with AVIF support
Transparency and animation Both supported Both supported

AVIF wins on file size. That's the headline and it's real. Google's own web.dev guidance notes tests showing greater than 50% savings compared to JPEG in some cases, and WordPress's AVIF announcement makes the same up-to-50% claim.

Where AVIF costs you is encoding time. Generating AVIF thumbnails for a large upload takes meaningfully longer than generating WebP or JPEG ones, which matters when you're bulk-uploading a product catalog or regenerating thumbnails across an existing library. On a constrained server, an aggressive AVIF conversion job across thousands of images can become its own performance problem while it runs.

The other AVIF caveat worth knowing: some users have reported color desaturation with wide-gamut source images. If you're publishing photography where color accuracy is part of the product, spot-check a few converted images against the originals rather than trusting the pipeline blindly.

Important: AVIF support depends on your server's image processing library. Check Tools → Site Health → Info → Media Handling in wp-admin to see whether your install can actually process AVIF before building a workflow around it.

Which Should You Actually Use?

For most WordPress sites in 2026, the pragmatic answer is: serve AVIF where you can, fall back to WebP, fall back to JPEG. This is exactly the pattern the <picture> element exists for, and it's what most conversion plugins implement under the hood.

If you're choosing just one because your setup can't do fallbacks cleanly, WebP is the lower-risk pick and AVIF is the higher-ceiling one. WebP's longer track record means fewer edge cases in older browsers, email clients, and third-party tools that might touch your images. AVIF gives you smaller files if your server can encode it and your audience's browsers can decode it, which in 2026 covers the large majority.

The Things That Actually Move the Needle

Here's the part that most format-focused articles skip. In rough order of how much they typically matter:

1. Serving Correctly Sized Images

This is almost always the biggest win, and it's the one format conversion cannot fix. A 3000-pixel-wide hero image compressed brilliantly into AVIF is still enormously larger than it needs to be when the visitor's phone displays it at 390 pixels wide.

WordPress's srcset system handles this automatically for images inserted through the editor, which is why "just use the media library properly" is underrated advice. The failure modes are:

  • Page builders and themes that output raw <img> tags without srcset, bypassing core's responsive images entirely.
  • CSS background images, which get no responsive image treatment at all and are entirely on you to size correctly.
  • Hardcoded image URLs in custom templates that point at a specific size, usually full.
  • A sizes attribute that doesn't match your actual layout. Core's default sizes value assumes the image fills the viewport width. If your content column is 720 pixels inside a 1400-pixel layout, the browser may download a larger file than it needs. This is fixable with the wp_calculate_image_sizes filter, and it's the kind of tuning that a well-built theme should already handle.

2. Not Uploading Enormous Originals

WordPress stores your original upload forever and generates sized versions from it. Uploading a 12-megapixel camera JPEG for a 600-pixel-wide blog thumbnail means storing and backing up that original indefinitely, and it means every thumbnail regeneration has to process it.

Resizing before upload, or enforcing a maximum dimension on upload, keeps the whole media library lighter. This also directly reduces backup size and restore time, which matters more than people expect on sites with years of accumulated media.

3. Getting the LCP Image Right

The Largest Contentful Paint element on most pages is an image, usually the hero or the first in-content image. Two rules:

  • Do not lazy-load it. Lazy loading your LCP image actively delays the metric it's measured by. Core's automatic lazy loading tries to avoid this by skipping the first image, but page builders and custom templates can defeat that logic.
  • Give it fetch priority. A fetchpriority="high" hint tells the browser to prioritize it over other resources competing for bandwidth.

Getting these two right on a single image often does more for measured page speed than converting every image on the site to AVIF.

4. Caching and Delivery

Optimized images still have to travel. An image served from a cache node near the visitor arrives faster than the same file served from an origin server on another continent, regardless of format. This is infrastructure rather than image work, but it's why two sites with identical images can post very different real-world load times.

On MagicWP's managed hosting, the global edge cache handles this layer automatically across multiple regions, so image delivery isn't something you configure per-site.

5. Format Conversion

Yes, it's last. Not because it doesn't help, but because it's the step whose benefit is most dependent on the four above already being right. Converting to AVIF on a site that ships full-size originals into thumbnail slots is optimizing the wrong variable.

That said, on genuinely image-heavy sites, galleries, portfolios, WooCommerce catalogs with multiple product photos per item, format conversion is a substantial and worthwhile win once sizing is handled.

A Practical Workflow

For a typical WordPress site in 2026:

  1. Check what your server supports. Tools → Site Health → Info → Media Handling tells you which formats your Imagick or GD build can process. Plan around reality, not around what you'd like to be true.
  2. Audit how images are actually output. View source on a few key pages and confirm your images have srcset and sizes attributes. If they don't, the theme or builder is bypassing core's responsive images and that's your first fix.
  3. Set an upload ceiling. Decide a maximum dimension (something like 2048 pixels on the long edge covers most layouts, since that's also core's default srcset cap) and enforce it, either through editorial process or a plugin.
  4. Fix the LCP image on your most-trafficked templates. Confirm it isn't lazy-loaded and carries a high fetch priority.
  5. Then add format conversion, serving AVIF with WebP and JPEG fallbacks. Test on staging first if you're converting an existing library, since bulk conversion is server-intensive and hard to undo casually.
  6. Measure before and after on real pages with a real tool, not by intuition.

Important: Bulk-converting an existing media library rewrites or supplements a large number of files. Take a backup first and run the conversion on a staging copy before production. MagicWP's on-demand backups and one-click staging cover both steps from the same dashboard.

Common Mistakes

Converting to a modern format but keeping the old dimensions. Covered above, but it bears repeating because it's the single most common wasted effort in this area.

Lazy-loading everything indiscriminately. Including the hero image. This is a net loss on the metric that matters most.

Assuming a plugin's "optimized" score means the job is done. Optimization plugins report on what they control, which is compression and sometimes format. They generally can't tell you that your theme is serving a 2000-pixel image into a 300-pixel slot.

Stacking multiple image optimization plugins. Two plugins both trying to rewrite image URLs, generate alternate formats, or filter srcset output will conflict in ways that are genuinely tedious to debug. Pick one.

Ignoring the encode cost. If your site accepts user-uploaded images, or your editors upload in bulk, AVIF encoding time becomes a real operational consideration, not a theoretical one.

Frequently Asked Questions

Does WordPress automatically convert my images to WebP or AVIF? No. WordPress core supports uploading and serving both formats, but automatic conversion of uploaded JPEGs was proposed for WordPress 6.1 and deliberately reverted. Conversion requires a plugin or a server-level solution.

Is AVIF better than WebP for WordPress? AVIF generally produces smaller files at comparable quality, and WordPress's own AVIF announcement cites up to 50% smaller than JPEG. The trade-offs are slower encoding and a dependency on your server's Imagick or LibGD build supporting AVIF. The best approach for most sites is serving AVIF with a WebP and JPEG fallback rather than picking one exclusively.

How do I check if my server supports AVIF? Go to Tools → Site Health → Info in wp-admin and expand the Media Handling section. It reports which image formats your server's processing library can handle.

Will converting my images to AVIF break older browsers? Not if you serve fallbacks. The <picture> element lets you offer AVIF first, WebP second, and JPEG last, so any browser gets a format it understands. Most conversion plugins implement this pattern automatically.

What's the single biggest image optimization win for a typical WordPress site? Serving correctly sized images. Format conversion reduces the bytes of an image; correct sizing reduces how many pixels you're sending in the first place, and on most sites the sizing problem is larger than the format problem.

Should I lazy-load all my images? No. Lazy-load images below the fold, but explicitly exclude your Largest Contentful Paint image, usually the hero or first in-content image. Lazy-loading that one delays the exact metric it's measured against.

Does image optimization affect SEO? Indirectly. Image weight affects Core Web Vitals, particularly Largest Contentful Paint, and page experience is part of how Google evaluates pages. But the effect is on the performance signal, not a direct "optimized images rank higher" mechanism.

Do I still need an image optimization plugin in 2026? For format conversion and bulk compression, yes, since core doesn't do those. For responsive images, lazy loading, and fetch priority, core already handles it, so a plugin adding those is duplicating work already done.

Conclusion

WordPress image optimization in 2026 is less about picking a format and more about not undoing the work core already does for you. Core generates responsive image sets, adds lazy loading and fetch priority, and serves AVIF and WebP without complaint. What it won't do is convert your existing library, stop your theme from bypassing srcset, or prevent you from lazy-loading the one image you shouldn't.

Get sizing and LCP right first, then add AVIF with sensible fallbacks, and verify on staging before running a bulk conversion across a production media library. If your host handles edge caching and backups for you, the whole process stops being a project and becomes an afternoon.

A
Alex
MagicWP
Writing about WordPress, performance, and the infrastructure that makes sites fast.

Get the best of MagicWP in your inbox.

Monthly engineering notes, product updates, and WordPress performance tips. No spam, unsubscribe anytime.

Join 12,000+ builders. We send one email a month.