How to Fix “Serve images in next-gen formats” (WebP & AVIF) in WordPress
Lighthouse triggers “Serve images in next-gen formats” whenever legacy JPEG or PNG images could save at least 8 KiB by switching to WebP or AVIF. Convert HTML, srcset, and CSS background images non-destructively.

Open WP Admin -> KadiCache -> Images, toggle ON Convert images to WebP, and keep Lossy · Balanced (Quality ~80–82) for 55%–80% smaller product and hero photos.
Need bit-exact pixel fidelity on medical diagrams or UI mockups? Select Lossless · Exact or exclude specific portfolio URLs inside Image Exclusions.
Ensure Improve LCP (Core Web Vitals) and Native Image Lazyload (Lazyload) are active so your prioritized hero WebP arrives first and below-the-fold WebPs defer cleanly.
- Lighthouse re-encodes every raster image (
JPEG,PNG,BMP) during its audit and flagsmodern-image-formats(anduses-optimized-images) whenever modern compression saves>= 8 KiB. - Why WordPress Core’s WebP upload setting leaves sites failing: it does nothing for your existing
5,000Media Library JPEGs/PNGs, theme/assets/images/*.pngfiles, or Elementor CSSbackground-imagebanners! - Unlike external image-proxy CDNs that rewrite your image URLs to a foreign third-party domain (hurting image SEO if you ever cancel), KadiCache stores converted
.webpfiles locally on your own WordPress domain! - Non-Destructive Guarantee: Original
.jpgand.pngfiles inwp-content/uploads/are never deleted or overwritten, and can be restored in 1 click at any time.
Table of Contents (5 sections)
- How Lighthouse Evaluates modern-image-formats & uses-optimized-images
- Why PNG Screenshots & WooCommerce Catalogs Fail So Badly on Mobile
- Manual Developer Fixes (WordPress Upload Filter & CLI Conversion)
- How KadiCache Cloud WebP Solves Image Compression With Zero Origin CPU
- WebP vs AVIF vs Legacy JPEG/PNG: Engineering Comparison for WordPress
How Lighthouse Evaluates modern-image-formats & uses-optimized-images#
Google PageSpeed Insights runs two closely related image byte-efficiency audits on every visible and eagerly loaded image:
Serve images in next-gen formats(modern-image-formats): Estimates byte savings from convertingJPEG/PNGimages into WebP or AVIF (>= 8 KiBsavings threshold per file).Efficiently encode images(uses-optimized-images): Flags uncompressedQuality 95–100Photoshop/Canva JPEGs where standardQuality 80–85perceptual encoding cuts60%+file weight with zero visible difference to the human eye.
Converting images to properly tuned WebP (Quality 80–82) clears both audits simultaneously—slashing Resource Load Duration on your hero banner (LCP) and accelerating visual progression (Speed Index)!
Why PNG Screenshots & WooCommerce Catalogs Fail So Badly on Mobile#
| Common WordPress Image Upload | Typical Raw Size | WebP (Quality 82) Size | Mobile 4G Load Time (1.6 Mbps) |
|---|---|---|---|
Canva / Uncompressed Hero Banner (.png) | 1,420 KB | 74 KB (-94.8%) | Drops from 7.1 s to 0.37 s! |
DSLR WooCommerce Product Photo (.jpg, Q98) | 540 KB | 58 KB (-89.2%) | Drops from 2.7 s to 0.29 s! |
Elementor Section Background Photo (.jpg) | 680 KB | 69 KB (-89.8%) | Drops from 3.4 s to 0.35 s! |
Transparent Brand Logo / Badge (.png) | 95 KB | 14 KB (-85.2%) | Drops from 0.48 s to 0.07 s! |
Manual Developer Fixes (WordPress Upload Filter & CLI Conversion)#
For brand-new uploads going forward on servers with Imagick or GD WebP compiled in PHP, WordPress 5.8+ provides a filter to generate WebP sub-sizes on upload:
add_filter('image_editor_output_format', static function (array $formats): array {
$formats['image/jpeg'] = 'image/webp';
$formats['image/png'] = 'image/webp';
return $formats;
});Why that PHP filter alone doesn’t clear PageSpeed Insights on existing sites:
- It does not convert any of your existing historical uploads, WooCommerce product catalogs, or theme
/assets/graphics. - Burning CPU cycles inside PHP
gd/imagickon a shared VPS while importing 500 WooCommerce CSV products spikes origin CPU to100%and times out504 Gateway Timeout!
How KadiCache Cloud WebP Solves Image Compression With Zero Origin CPU#
- Zero Origin PHP CPU Load (
WP Admin -> KadiCache -> Images): Image compression runs off-server in KadiCache Cloud Pro (Cloud WebP Guide), then publishes verified.webpfiles back onto your own WordPress domain—zero504timeouts and zero foreign CDN lock-in! - Complete HTML,
srcset,<picture>& CSS Coverage (ExtensionImages.php&ImageUrlMap.php): Rewrites standard<img src>, every responsivesrcsetcandidate, and CSSbackground-image: url(...)rules automatically—even inside reduced inline<style>blocks! Lossy · BalancedvsLossless · ExactSize Guard: Choose Lossy · Balanced (default82quality) for photographs, or Lossless · Exact for pixel-exact technical graphics; if a tiny pre-optimized PNG would ever grow larger as WebP, KadiCache keeps the smaller original automatically.- 100% Non-Destructive & Reversible (
Cloud Connection/Image Exclusions): Your original.jpg/.pngfiles remain untouched inwp-content/uploads/. Exclude downloadable print files or photography galleries viaImages -> Exclusions(images-pro-exclusions-modal) or restore originals in 1 click!
WebP vs AVIF vs Legacy JPEG/PNG: Engineering Comparison for WordPress#
Site owners often ask whether WebP is sufficient to pass Google PageSpeed Insights 100 / 100 or if every image must be re-encoded twice into AVIF:
| Image Format | Compression vs Raw JPEG/PNG | Browser & Social App Support | Encoding Speed & Edge Cases |
|---|---|---|---|
Legacy JPEG / PNG | Baseline (100% weight — heavy!) | 100% universal (best kept for <meta property="og:image"> social cards) | Fails modern-image-formats whenever >= 8 KiB savings exist |
Modern WebP (Lossy Q82 / Lossless) | -55% to -85% smaller (clears PSI green!) | 98.7%+ global support (Safari iOS 14+, Chrome, Edge, Firefox, Android) | Crisp textures, full alpha transparency, fast decode on budget phones |
AVIF | -60% to -88% smaller on smooth gradients | ~93% browser support (older enterprise/webview clients need fallback) | 8×–12× heavier encode cost; can over-smooth fine fabric/skin grain at low bitrates |
Notice a subtle SEO detail KadiCache handles safely: social link-preview crawlers on legacy messaging apps sometimes expect <meta property="og:image"> in <head> to remain a standard .jpg/.png or widely supported .webp URL on your primary domain. Because KadiCache keeps your original .jpg and .png files live on disk while rewriting storefront <img>, srcset, and CSS background-image URLs to local .webp assets, social previews, RSS feeds, and downloadable links never break!
# Confirm your converted WebP serves directly from your domain with 1-year cache headers:
curl -sI "https://your-site.com/wp-content/kadicache-assets/images/hero-banner.webp" | grep -iE "http/|content-type|content-length|cache-control"
# Expected Output:
# HTTP/2 200
# content-type: image/webp
# content-length: 61840
# cache-control: public, max-age=31536000, immutable“Serve images in next-gen formats” — Frequently Asked Questions
Do all modern iPhone (Safari iOS), Android, Mac, and Windows browsers support WebP?
What happens to my images if I ever disconnect KadiCache Cloud Pro or deactivate the plugin?
Does WebP preserve transparent backgrounds on PNG logos and product cutouts?
Why did one external Instagram or third-party badge image still appear in modern-image-formats?
Will Google Images index local .webp product photos normally for WooCommerce SEO?
Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.
Configure Lossy vs Lossless WebP modes, quality sliders, and exclusions.
Pair WebP compression with responsive srcset dimensions for mobile cards.
Preload your converted WebP hero banner at fetchpriority="high".
Explore KadiCache’s non-destructive local WebP architecture.