DEV Community

Syed Owais Ali
Syed Owais Ali

Posted on

WordPress LCP: the 5 fixes that actually move the number

Most WordPress performance advice is a list of twenty things. In practice, Largest Contentful Paint on a typical WordPress site is decided by about five of them — and the other fifteen are rounding errors you can chase for a week without changing the score.

Here's the short version of where LCP actually goes, in the order that's usually worth fixing.

1. Your LCP element is probably the hero image — find out for sure first

Before changing anything, confirm what the browser considers the LCP element. Open Chrome DevTools → Performance → record a load → look at the "LCP" marker in the Timings track. It'll point at the exact node.

This matters because the fix is completely different depending on the answer. If LCP is a hero image, you optimize delivery. If it's a block of text, your problem is font loading. If it's a background image set in CSS, the browser can't even discover it until the stylesheet parses, which is its own category of slow.

Skipping this step is the single most common reason people optimize for a week and see no change.

2. Preload the LCP image, and stop lazy-loading it

WordPress adds loading="lazy" to images by default. That's good for everything below the fold and actively harmful for the one image that is your LCP element — you've told the browser to deprioritize the exact thing the metric measures.

// functions.php — skip lazy loading for the first content image
add_filter('wp_img_tag_add_loading_attr', function($value, $image, $context) {
    static $first = true;
    if ($context === 'the_content' && $first) {
        $first = false;
        return false;
    }
    return $value;
}, 10, 3);
🔥 Jadwal & Hasil: syed owaisali c/wordpress lcp the fixes that actually move the number pmn - Jadwal Siaran Langsung 🔥 Jadwal & Hasil: syed owaisali c/wordpress lcp the fixes that actually move the number pmn - Jadwal Siaran Langsung

Then preload it in <head>:

<link rel="preload" as="image" href="/hero.webp" fetchpriority="high">
🔥 Jadwal & Hasil: syed owaisali c/wordpress lcp the fixes that actually move the number pmn - Jadwal Siaran Langsung 🔥 Jadwal & Hasil: syed owaisali c/wordpress lcp the fixes that actually move the number pmn - Jadwal Siaran Langsung

fetchpriority="high" is doing real work here. It tells the browser this resource jumps the queue instead of competing with your stylesheets and scripts.

3. Serve the image at the size you actually display

This sounds obvious and it's still the biggest single win on most sites I look at. A 2400px-wide JPEG rendered into an 800px container is roughly 9x more pixels than needed, and on a mobile connection that's seconds, not milliseconds.

Two things to get right:

  • Format. WebP is well supported now; AVIF is smaller again if your tooling handles it. Either beats a JPEG.
  • Responsive sizes. WordPress generates srcset automatically, but the sizes attribute it guesses is frequently wrong for custom themes. If sizes says 100vw and your image sits in a 600px column, mobile browsers download the wrong candidate.

4. Fix render-blocking CSS before you touch JavaScript

Everyone reaches for JavaScript first because there's more of it. But JS loaded with defer or async doesn't block rendering, while every stylesheet in <head> does — the browser won't paint until it has the CSS.

On a typical WordPress install with a page builder you'll find a dozen stylesheets: theme, parent theme, three plugins, a font library, an icon set. Each one is a round trip before anything appears.

What helps, in order of impact:

  • Dequeue stylesheets on pages that don't use them. Your contact form's CSS doesn't need to load on the blog archive.
  • Inline the critical above-the-fold CSS and load the rest asynchronously.
  • Drop icon font libraries entirely. If you're using six icons, inline them as SVG and delete the 200KB font.

5. Self-host fonts, and preload the one you need

Google Fonts via fonts.googleapis.com costs you a DNS lookup, a TLS handshake, a CSS file, and then the font file — a chain of requests that has to finish before your text renders.

Self-host instead:

<link rel="preload" as="font" type="font/woff2" href="/fonts/inter-var.woff2" crossorigin>
🔥 Jadwal & Hasil: syed owaisali c/wordpress lcp the fixes that actually move the number pmn - Jadwal Siaran Langsung 🔥 Jadwal & Hasil: syed owaisali c/wordpress lcp the fixes that actually move the number pmn - Jadwal Siaran Langsung

Pair it with font-display: swap so text paints in a fallback immediately rather than sitting invisible. If your LCP element is text, this one change often moves the number more than everything else combined.

What I'd skip

  • Minifying HTML. Measurable in theory. Invisible in practice.
  • Changing to a "faster" theme before diagnosing. You often inherit a different set of the same problems.
  • Stacking caching plugins. Two cache layers fighting each other is a support ticket, not an optimization.
  • Chasing a 100 Lighthouse score. Lighthouse runs a simulated throttle in a lab. Field data in Search Console's Core Web Vitals report is what Google actually uses.

The order that works

Diagnose the LCP element → preload it with high priority → right-size and reformat it → cut render-blocking CSS → self-host fonts. Measure after each step, not at the end, so you know which change did what.

Most sites get the majority of their improvement from the first three. The rest is cleanup.


I'm a co-founder at Velrix Digital, where we build and optimize WordPress, Shopify and Next.js sites. Happy to answer questions in the comments.

Top comments (1)

🔥 Jadwal & Hasil: syed owaisali c/wordpress lcp the fixes that actually move the number pmn - Jadwal Siaran Langsung
 
mytoolstudio profile image
My Tool Studio •

Nice, short list. One thing worth checking before adding the filter in #2: since WordPress 6.3, core already tries to do this itself. It skips lazy-loading and adds fetchpriority="high" to the image it guesses is the LCP. The guess goes by content order, so with sliders, page builders or a hero set as a CSS background it often picks the wrong image. Quick check: view the rendered HTML and confirm the real hero has fetchpriority="high" and no loading="lazy", and that no other image is also marked high priority.