Fix guides · Performance

How to fix a slow Largest Contentful Paint (LCP)

LCP is when the biggest thing at the top of your page appears, usually the main image. How to make it load first on Shopify, WordPress, Webflow, Wix, Squarespace and Next.js.

Time to fix
30–60 minutes
Skill needed
Copy and paste
Who notices
Every visitor: the page looks unfinished for longer

Why it matters

Largest Contentful Paint (LCP) is the moment the largest image or block of text at the top of the page finishes appearing. It's when visitors feel the page has loaded, and it's one of Google's Core Web Vitals. Good is 2.5 seconds or less.

On most sites the LCP element is an image: a hero banner, a product photo, a slideshow's first slide. The common causes of a slow LCP are that image being lazy-loaded, found late (set as a CSS background or added by a script), not marked as important, or simply too large.

“By running an A/B test specifically focused on optimizing Web Vitals, Vodafone found that a 31% improvement in LCP led to 8% more sales, a 15% improvement in their lead to visit rate, and a 11% improvement in their cart to visit rate.”

web.dev: Vodafone case study

Before you start

  • Your report names the LCP element. Check it's what you expect: on phones it may be a different image, or a block of text.
  • Never lazy-load that element. Give it fetchpriority="high" instead, and only that one or two images: marking everything as important helps nothing.
  • Put the main image in the page as an <img>, not as a CSS background or something a slider script adds later, so the browser finds it straight away.
  • If the image is already prioritized, the next cause is size: see our image delivery guide. If the server itself is slow, nothing loads early: see our server response guide.

Fix it on your platform

Shopify

  1. Shopify's image_tag filter makes images lazy-load automatically in sections further down the page. If your hero is lazy-loaded anyway (check the report's LCP element), the theme's own logic is overriding that.
  2. In your theme code, give the first section's main image fetchpriority="high" and loading="eager". Shopify's section.index tells you whether a section is at the top of the page.
  3. Use image_url and image_tag rather than building image URLs by hand, and use <img> rather than a CSS background-image for hero banners.
  4. Pop-ups and dialogs that cover the page on load can become the LCP element. Keep them smaller than your main content or show them later.
sections/hero.liquid
{%- liquid
  assign loading = 'lazy'
  assign priority = 'auto'
  if section.index == 1
    assign loading = 'eager'
    assign priority = 'high'
  endif
-%}
{{ section.settings.image
  | image_url: width: 1600
  | image_tag: loading: loading, fetchpriority: priority, sizes: '100vw' }}

WordPress

  1. Since WordPress 6.3, WordPress adds fetchpriority="high" to the image it judges most likely to be the LCP image and doesn't lazy-load it. Update WordPress if you're on an older version.
  2. That only covers images WordPress outputs itself. Sliders, page builders and some themes add their own lazy loading: turn it off for the first image or slide in that tool's settings.
  3. Performance plugins with a lazy-load feature usually have an option to exclude the first images on the page. Use it.

Webflow

  1. Select the main image at the top of the page, open its settings and set its loading behavior to Eager. New images in Webflow are set to Lazy by default.
  2. If your hero is a section's background image, consider an Image element instead: browsers find background images later.
  3. Avoid fade-in or slide-in interactions on the hero image; it isn't counted as shown until the animation reveals it.

Wix

  1. Wix manages how images load. What you control is what sits at the top of the page.
  2. Upload the main image as JPG or WebP, not PNG, and resize very large photos before uploading.
  3. Wix advises against animating the LCP element, because animations like fade-in only start once the site has fully loaded. Turn off entrance animations on the hero.
  4. Move heavy elements such as galleries, videos and store widgets below the first screen.

Squarespace

  1. Squarespace manages how images load. What you control is what sits at the top of the page.
  2. Keep the first image under about 500 KB and between 1500 and 2500 pixels wide, as Squarespace recommends. Resize and compress it before uploading.
  3. Prefer a single image to a gallery or slideshow in the first section.

Next.js

  1. next/image lazy-loads by default. On the image at the top of the page, set loading="eager" and fetchPriority="high". The old priority prop is deprecated in Next.js 16.
  2. Render the hero on the server. If it only appears after client-side JavaScript runs or data loads, the browser can't start fetching it early.
next/image
<Image src={hero} alt="…" sizes="100vw" loading="eager" fetchPriority="high" />

Any other site

  1. Put the main image in the HTML as an <img>, without loading="lazy", and add fetchpriority="high".
  2. If the image is only found later (a CSS background, or added by JavaScript), preload it in the <head> with the same priority.
HTML
<img src="/img/hero.webp" width="1600" height="900" alt="…" fetchpriority="high">

<!-- Only if the image isn't in the HTML itself -->
<link rel="preload" as="image" href="/img/hero.webp" fetchpriority="high">

“One cause for slow LCP is lazy-loading the LCP element. Usage of this antipattern has decreased, but 15% of websites still fail this test and could benefit from removing lazy-loading for their LCP elements.”

HTTP Archive Web Almanac 2024, Performance

Check that it's fixed

  • Re-run your StudioLNC audit. Lab timings vary a little from run to run, so look for a clear drop rather than an exact number.
  • The LCP insight should no longer say the image is lazy-loaded or missing fetchpriority.
  • Real-visitor LCP in your Vitals Monitor follows over the next four weeks.

Find every issue like this on your site

Free audit of performance, accessibility, SEO and security, with fixes for your platform.