How to Fix “Preload Largest Contentful Paint image” in WordPress & WooCommerce
Lighthouse triggers “Preload Largest Contentful Paint image” whenever your main above-the-fold hero banner is discovered late inside CSS/JS or starved of network bandwidth by accidental lazy-loading and missing fetchpriority="high".

Open WP Admin -> KadiCache -> Lazyload and ensure above-the-fold logos/heroes are protected (or enable Pro Local Improve LCP to detect and strip hero lazy-loading per viewport automatically).
Open WP Admin -> KadiCache -> Core Web Vitals -> LCP & Layout Pro and toggle ON Improve LCP so Desktop and Mobile LCP candidates receive responsive <link rel="preload" as="image" fetchpriority="high"> hints.
Enable Cloud WebP Conversion in WP Admin -> KadiCache -> Images so the prioritized hero image downloads in 45–85 KB instead of 650 KB.
- Lighthouse flags
prioritize-lcp-image(and its companionlcp-lazy-loaded) when the Largest Contentful Paint (LCP) image was not discoverable at high priority inside the initial HTML<head>. - Out of the 4 official W3C LCP sub-parts,
Resource Load Delay(time betweenTTFBand starting the hero image download) should be< 10%of total LCP—yet Elementor CSS backgrounds and lazy-loaded sliders waste800–1,600 msbefore byte #1 of the hero image is even requested! - Critical Responsive Trap: Hardcoding
<link rel="preload" as="image" href="/hero-1920.jpg">withoutimagesrcsetandimagesizesforces mobile phones to download both the1920pxpreload and the768pxsrcsetcandidate—doubling bandwidth waste! - Verified KadiCache Fix: Pro Local Improve LCP detects Desktop and Mobile LCP elements independently, injects
imagesrcset-matched<head>preloads withfetchpriority="high", and strips accidentalloading="lazy".
Table of Contents (6 sections)
- Why Chrome’s Preload Scanner Misses WordPress Hero Images
- Manual Developer HTML & PHP Fix (And the srcset Double-Download Trap)
- How KadiCache Solves prioritize-lcp-image Automatically
- Layer 1 — Free Core Smart Lazy-Load Guards (ImageLazyOptimizer.php)
- Layer 2 — Cloud Pro Improve LCP (Separate Desktop & Mobile Detection)
- How All 4 W3C LCP Sub-Parts Respond on a Mobile WooCommerce Product Page
Why Chrome’s Preload Scanner Misses WordPress Hero Images#
Modern Chromium ships a fast, speculative HTML Preload Scanner that scans raw HTML tokens ahead of the main parser so critical <img src="..."> assets start downloading right after TTFB. When everything works properly, your hero image begins downloading within 20 ms of receiving HTML.
On WordPress, Elementor, Divi, and WooCommerce storefronts, four antipatterns blind that Preload Scanner completely:
| WordPress Hero Antipattern | Why Chrome Discovers the Image Late | Measured Mobile LCP Penalty |
|---|---|---|
Elementor / Gutenberg Cover background-image: url(...) in External CSS | Preload Scanner only reads HTML—it cannot see background-image URLs inside external .css files until CSS downloads, CSSOM builds, and style matching runs! | +650 ms to +1,500 ms Resource Load Delay |
loading="lazy" Applied to the Hero Image (lcp-lazy-loaded) | A page-builder widget or naive regex lazy-loader tagged the #1 viewport image loading="lazy", forbidding Chrome from fetching it until layout completes! | +400 ms to +950 ms Resource Load Delay |
Missing fetchpriority="high" Alongside 20 Header/Grid Images | Without fetchpriority="high", Chrome starts <img> tags at Low or Medium network priority—sharing mobile 4G bandwidth with 16 mega-menu thumbnails and footer icons | +250 ms to +600 ms Resource Load Duration |
JavaScript Carousel (Swiper / Slider Revolution) Injecting data-src | Hero <img> has an empty or 1×1 placeholder src until swiper.min.js downloads and executes on the main thread | +900 ms to +2,200 ms combined delay |
Manual Developer HTML & PHP Fix (And the srcset Double-Download Trap)#
On a custom-coded WordPress template where you control the exact hero markup, you must pair fetchpriority="high" + decoding="async" on the <img> tag with a responsive imagesrcset <link rel="preload"> inside wp_head:
add_action('wp_head', static function (): void {
if (!is_singular() || !has_post_thumbnail()) {
return;
}
$thumbId = get_post_thumbnail_id();
$src = wp_get_attachment_image_url($thumbId, 'large');
$srcset = wp_get_attachment_image_srcset($thumbId, 'large');
$sizes = wp_get_attachment_image_sizes($thumbId, 'large') ?: '100vw';
if (!$src) {
return;
}
printf(
'<link rel="preload" as="image" href="%s"%s fetchpriority="high">' . "\n",
esc_url($src),
$srcset ? sprintf(' imagesrcset="%s" imagesizes="%s"', esc_attr($srcset), esc_attr($sizes)) : ''
);
}, 2);Why manual wp_head snippets break on real marketing & WooCommerce sites:
- Landing pages built in Elementor, Bricks, Divi, or Gutenberg rarely store their hero banner in WordPress’s classic
post_thumbnailfield! - Many responsive sites display a wide landscape hero on Desktop (
1440px) and a completely different portrait banner or product card on Mobile (390px). A single PHP snippet preloads the hidden desktop banner onto mobile phones—wasting180 KBof mobile data and making mobile LCP slower!
How KadiCache Solves prioritize-lcp-image Automatically#
Layer 1 — Free Core Smart Lazy-Load Guards (ImageLazyOptimizer.php)#
- KadiCache’s Free Core Media Lazyload uses
ImageContainerClassifier.phpto recognize structural header, logo, and hero containers—refusing to slaploading="lazy"indiscriminately across your top-of-page visuals, backed by manual filename/selector exclusions inLazyload -> Excluded Image Files & Page Paths.
Layer 2 — Cloud Pro Improve LCP (Separate Desktop & Mobile Detection)#
Toggle ON Improve LCP inside WP Admin -> KadiCache -> Core Web Vitals -> LCP & Layout Pro (Pro Local Improve LCP Guide):
- True Per-Viewport LCP Discovery: KadiCache identifies the actual painted LCP element separately for Mobile and Desktop cache variants—whether it is a standard
<img>, a WooCommerce product gallery photo, a<picture>source, or a CSSbackground-imagebanner! - Responsive
<head>Preload Injection: Injects<link rel="preload" as="image" ... fetchpriority="high">with exact matchingimagesrcsetandimagesizesright at the top of<head>so Chrome’s Preload Scanner starts fetching the right image size att = 0with zero double downloads. - Hero Tag Upgrade & Competing Image Demotion: Strips any accidental
loading="lazy"ordata-lazyattributes from the LCP element, stampsfetchpriority="high" decoding="async" data-kadicache-lcp="1", and lowers competing secondary above-the-fold thumbnails so 100% of early TCP congestion window bandwidth streams into your hero image. - Pair With Cloud WebP Conversion (
ImagesTab): Shrinking a580 KBJPEG hero to a64 KBlocal WebP (Cloud WebP Guide) slashesResource Load DurationalongsideResource Load Delay!
How All 4 W3C LCP Sub-Parts Respond on a Mobile WooCommerce Product Page#
Google’s Chrome team recommends keeping Resource Load Delay and Element Render Delay under 10% of your total 2,500 ms LCP budget (<= 250 ms each). Watch what happens across all four sub-parts when KadiCache Early Delivery, Inline Used CSS, Cloud WebP, and Improve LCP work together:
| W3C LCP Sub-Part | Unoptimized Storefront (4,280 ms Poor) | With KadiCache Stack (1,390 ms Good) | Primary Control Responsible |
|---|---|---|---|
1. TTFB (Server Response) | 690 ms (16%) | 32 ms (2%) | Early advanced-cache.php + Cloudflare Edge |
2. Resource Load Delay | 1,340 ms (31% — late CSS/lazy discovery!) | 28 ms (2%) | Pro Local Improve LCP (<head> preload + strip lazy) |
3. Resource Load Duration | 1,620 ms (38% — 540 KB JPEG at Low priority) | 1,260 ms (91% — 62 KB WebP at High priority) | Cloud WebP + fetchpriority="high" |
4. Element Render Delay | 630 ms (15% — blocked by CSS/JS!) | 70 ms (5%) | Inline Used CSS + Delay JS |
When your site also runs behind Cloudflare Speed & Network with HTTP 103 Early Hints enabled, Cloudflare can even transmit the Link: <...>; rel=preload; as=image hint to mobile browsers while the HTML packet is still in flight!
“Preload Largest Contentful Paint image” — Frequently Asked Questions
What if my Largest Contentful Paint element is an <h1> text heading instead of an image?
Why did Chrome Console print “The resource was preloaded using link preload but not used within a few seconds”?
Does WordPress 6.3+ native fetchpriority="high" already fix this audit automatically?
Should I put my hero image on an external CDN CNAME or serve it from the same origin?
Why does PageSpeed Insights also show “Largest Contentful Paint image was lazily loaded”?
Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.
Master all 4 W3C LCP sub-parts: TTFB, Load Delay, Load Duration & Render Delay.
Configure dual-viewport LCP preloading and per-page exclusions.
Remove CSSOM render delay after your hero image finishes downloading.
Inspect KadiCache’s automatic mobile + desktop LCP prioritization.