promptunit

LCP Fixer: Find the Real Slow Element and Fix It

Many teams compress the hero image and upgrade the server, and LCP still fails, because the browser was measuring a different element all along. This prompt finds your real LCP element on each page type, then gives you the exact fixes in the right order.

Works in ChatGPTClaudeGemini592 words6 inputs to fillSEO-042

Example input

This is exactly what we gave the model. You replace it with your own details.

- Website: https://www.example.com (online plant shop)
- Platform and theme: Shopify with a page-builder theme
- Page types failing LCP and example URLs: Home (/), collection pages (/collections/indoor-plants/), product pages (/products/monstera-deliciosa-large/)
- Field data (CrUX or Search Console Core Web Vitals report): LCP p75 for mobile and desktop: LCP p75: mobile 4.1 s, desktop 2.3 s
- PageSpeed Insights details: LCP element shown, and the LCP breakdown (time to first byte, resource load delay, resource load time, element render delay): Collection page: LCP element shown is 'div.promo-banner > img' (a banner below the product grid's first row), not the hero image. Breakdown: TTFB 0.7 s, resource load delay 1.6 s, resource load time 0.9 s, element render delay 0.9 s. The hero section is a slider with a 0.8 s fade-in, and all images have loading='lazy' set by the theme.
- Do editors or merchants rearrange page sections (page builder, sliders)? Yes. Our merchandiser reorders sections on collection pages every week with the page builder.

Real output

Pasted straight from the model. We did not fix a word.

LCP fix plan for your Shopify plant shop

Short version: Mobile LCP is 4.1 s. That is in the "poor" range, which starts above 4.0 s. Desktop is 2.3 s and already passes (good is 2.5 s or less), so mobile is the target.

On your collection page, the browser is not measuring the hero at all. The hero fades in over 0.8 s, so Chrome measures the promo banner further down instead. The theme lazy-loads that banner, so the browser starts downloading it late. This means work on the hero image or server speed alone would miss the target. Fix the fade and the lazy loading first, then check again which element the browser measures.


Missing details: my best guesses

Correct me if any guess is wrong. I use these guesses for the rest of the answer.

  1. What LCP element and breakdown does PageSpeed Insights (mobile) show for your home and product pages? Guess: On product pages, it's the first image in the product gallery. On the home page, it's an element below the hero, for the same fade-in reason as on the collection page.
  2. Are 4.1 s and 2.3 s for the whole site (origin) or for these exact URLs? Guess: The whole site, from the CrUX part of PageSpeed Insights. Search Console groups URLs differently, so its numbers can be different.
  3. Is your "page builder" the Shopify theme editor (sections in JSON templates), or an app like PageFly, GemPages or Shogun? Guess: The theme editor's own sections. If it's an app, the Liquid snippets below won't fit, and you should use the app's per-image lazy-load setting instead.
  4. Is the promo banner a block inside the product grid section, or a separate section? Guess: A block inside the grid, set to show after the first row.
  5. Which apps add scripts to these pages? Guess: 8 to 15 apps (reviews, upsell, chat, wishlist, tracking), with a few loading scripts in the <head>.

Step 1: Confirm the real LCP element for each page type

Test 2 or 3 URLs per page type on mobile. The element can be different on each page type and screen size.

  1. PageSpeed Insights, Mobile tab. Under Diagnostics, open "Largest Contentful Paint element" and the "LCP breakdown". The top part shows field data: for the URL if it has enough traffic, otherwise for the whole site.
  2. Chrome DevTools, Performance panel. Open the page in an Incognito window. Turn on device mode with a phone size, set CPU to 4x slowdown and network to "Slow 4G". The Live metrics view shows the LCP element while the page loads. Then click Record and reload. The LCP breakdown insight shows the four parts and highlights the element on the page.
  3. Console check. Snippet 1 below lists every LCP candidate. The last one is your LCP element.
  4. Field check with the web-vitals library. Snippet 3 shows which element real users get, by page type. This check decides, because field data decides the Core Web Vitals result, not lab scores.
  5. Is the LCP image in the raw HTML? Right-click > View page source, then search for the image file name. If it's not there, your page builder adds it with JavaScript. That adds load delay, and you'll need a preload (Snippet 8).

Your merchandiser reorders collection sections every week, so the LCP element can change every week. Check again after each reorder (see the weekly check in the verify plan).

Your collection page breakdown, in plain words (lab data from PageSpeed Insights)

PartTimeShareWhat it meansTarget (guess, for a ~2 s lab LCP)
Time to first byte (TTFB)0.7 s17%Shopify builds the page and sends the first byte0.6 s or less
Resource load delay1.6 s39%The wait between the first byte and the moment the browser starts downloading the banner0.2 s or less
Resource load time0.9 s22%The time to download the banner file0.6 s or less
Element render delay0.9 s22%The banner has downloaded but is not on screen yet0.2 s or less
Total4.1 sabout 1.6–2.0 s

Biggest problem: resource load delay (1.6 s). Your theme sets loading="lazy" on every image, including this banner. Lazy loading tells the browser to wait until it has worked out the page layout and knows the image is on screen. Lazy images also get low priority behind CSS and JavaScript.

Render delay (0.9 s), guess: A fade-in or "reveal on scroll" animation on the banner's section, or page-builder and app JavaScript keeping the browser busy.

Load time (0.9 s), guess: The banner file is bigger than a phone needs. This happens with a missing or wrong sizes attribute, or a very large uploaded image.


Summary table

Page typeReal LCP elementBiggest delay partMain causeFix
Collection (/collections/indoor-plants/)Confirmed in lab (PageSpeed Insights, mobile): div.promo-banner > img, not the hero. Still to confirm in field data (Snippet 3).Resource load delay: 1.6 s of 4.1 sThe theme lazy-loads every image, including this banner. The 0.8 s hero fade-in stops Chrome from measuring the hero. Render delay comes from animations or blocking JS (guess).1) Remove the hero fade and lazy loading on images that are on screen at load. 2) Test again to confirm the LCP element. 3) Add fetchpriority="high" to that one image. 4) Serve it at the right size.
Product (/products/monstera-deliciosa-large/)Not confirmed. Guess: the first image in the product gallery.Guess: load delay (first image is lazy), then render delay (gallery waits for slider JS)Guess: the same theme-wide lazy loading, plus a gallery fade or slider scriptConfirm in Step 1 first. If it's the first gallery image: load it right away with fetchpriority="high", and show the first slide without waiting for JS.
Home (/)Not confirmed. Guess: an element below the hero, because the hero fades in.Guess: resource load delayGuess: the same slider fade and lazy loadingConfirm in Step 1 first. The theme-wide fade and lazy fixes apply here too. Then add fetchpriority="high" to the confirmed element only.

Ranked fix list with impact and effort

Make every change on a duplicate theme first (Online Store > Themes > … > Duplicate), test it, then publish.

Collection pages (LCP element confirmed in lab)

RankFixBreakdown part it cutsImpactEffort
C1Turn off the hero's 0.8 s fade-in and any "reveal on scroll" animation on the first two sections. Use the theme setting if one exists (often under Theme settings > Animations, or the slideshow section's transition setting). Otherwise use Snippets 4 and 5.Element render delay. It also lets Chrome see the hero at first paint.High (guess: up to about 0.8 s)Low (15–30 min)
C2Remove loading="lazy" from images that are on screen at load: the first slide of the top two sections, the first 4 product cards, and the promo banner when it sits in the first two rows (Snippets 4–6).Resource load delay (1.6 s)High (guess: 1.6 s down to about 0.3 s)Low–medium (1–2 h of Liquid)
C3Test again with PageSpeed Insights mobile and DevTools. After C1, the hero may become the LCP element. Then add fetchpriority="high" to that one image only: hero slide 1 or the promo banner, never both unless both are confirmed key images.Resource load delayHighLow
C4Make slide 1 show without waiting for the slider script (Snippet 5). Better still, on collection pages use one static image instead of a slider.Element render delayMedium–highLow–medium
C5Serve the confirmed LCP image at the right size: image_tag with widths and a correct sizes. Guess: the target is under about 150 KB on mobile.Resource load time (0.9 s)Medium (guess: about 0.3–0.5 s)Low
C6Preload, only if the confirmed LCP image is a CSS background or added by JavaScript (Snippet 8)Resource load delayMedium (only in that case)Low
C7Make the rules position-based (section.index, first rows of the grid), so weekly reorders can't break them. Add the weekly 2-minute check.Keeps all the gainsHigh over timeLow–medium

Rough result (guess): C1–C5 should bring collection lab LCP on mobile from 4.1 s to about 2.0–2.5 s.

Product pages (confirm first)

RankFixBreakdown part it cutsImpactEffort
P1Confirm the LCP element on 3 product URLs (Step 1)—Needed before P2–P4Low
P2If it's the first gallery image: load it right away (no lazy) with fetchpriority="high". Keep all other gallery images lazy (Snippet 7).Resource load delayHighLow
P3Show the first gallery image without waiting for the gallery or zoom script, with no fade or zoom-in effectElement render delayHighLow–medium
P4Fix sizes and widths on gallery images, so a phone doesn't download a desktop-size fileResource load timeMediumLow
P5Defer or remove app scripts on product pages (reviews, upsell, sticky add-to-cart). These are usually your heaviest pages for apps (guess).Render delay and load delayMedium–highMedium

Home page (confirm first)

The worst problems are often on collection and product pages, not the home page. So home comes last.

RankFixBreakdown part it cutsImpactEffort
H1Confirm the LCP element (Step 1)—Needed before H3Low
H2The theme-wide fixes from C1 and C2 (no fade, no lazy on top sections) already apply to the home pageRender delay and load delayHighDone with C1 and C2
H3Add fetchpriority="high" to the confirmed LCP image onlyResource load delayMedium–highLow
H4Replace the hero slider with one static image (one strong image usually sells better on mobile too)Element render delayMediumLow

Deeper fixes (all page types, after the quick wins)

RankFixBreakdown part it cutsImpactEffort
D1Cut render-blocking JS and CSS. In the theme editor, turn off unused app embeds. Remove leftover code from deleted apps in theme.liquid and in snippets. Add defer to theme and page-builder scripts (Snippet 9). Load jQuery only if the theme really needs it.Render delay, and load delay (less fighting for bandwidth)Medium–highMedium
D2TTFB (0.7 s). Profile the Liquid with the Shopify Theme Inspector for Chrome extension. Fix slow loops, like a big mega menu, filter loops, metafield lookups in product cards, or all_products lookups. Show fewer products per collection page (for example 24 instead of 48, guess). Remove redirect chains (old URLs in ads or emails, geo-redirect apps).TTFBMediumMedium–high
D3Caching and CDN. Shopify runs the servers, CDN and caching for you. You can't change them, and you shouldn't put another proxy in front of the store. Your TTFB levers are Liquid code and apps (D2).———
D4Image formats and sizes, theme-wide. When you use image_url, Shopify's CDN already serves modern formats like WebP to browsers that support them. Your job is size: upload images about 2,000–2,400 px wide, not 5,000 px or more, and always use image_tag with widths and sizes.Resource load timeMediumLow–medium
D5Fonts. Use at most 2 font families from Shopify's font picker, with {{ settings.type_body_font | font_face: font_display: 'swap' }}. This only matters if a text block becomes the LCP element.Render delayLowLow
D6Non-standard lazy loading. If Snippet 2 finds images with only data-src (common in older page builders), switch them to a normal src or srcset. This also helps Google index your plant photos.Load delay, and image SEOLow–mediumLow

Code snippets

File names and class names below are guesses. Match them to your theme.

1. Find the LCP element (DevTools Console)

Paste this after the page loads, without clicking or scrolling. buffered: true also shows the candidates from before you pasted it.

new PerformanceObserver((list) => {
  for (const entry of list.getEntries()) {
    console.log('LCP candidate at', Math.round(entry.startTime), 'ms:',
      entry.element, entry.url || '(text)');
  }
}).observe({ type: 'largest-contentful-paint', buffered: true });
// The LAST line printed is your LCP element.

2. Find lazy images on screen, data-src images and missing sizes (DevTools Console)

Run this at the top of the page, without scrolling.

document.querySelectorAll('img').forEach((img) => {
  const r = img.getBoundingClientRect();
  const onScreen = r.bottom > 0 && r.top < innerHeight && r.width > 0;
  if (onScreen && img.loading === 'lazy') console.warn('Lazy but on screen:', img);
  if (!img.getAttribute('src') && (img.dataset.src || img.dataset.srcset))
    console.warn('Only data-src (bad for indexing):', img);
  if (!img.getAttribute('width') || !img.getAttribute('height'))
    console.info('Missing width/height (layout shift risk):', img);
});

3. Field data: LCP element and breakdown by page type (layout/theme.liquid, before </body>)

<script type="module">
  import { onLCP } from 'https://unpkg.com/web-vitals@5/dist/web-vitals.attribution.js?module';

  onLCP(({ value, rating, attribution: a }) => {
    const data = {
      page_type: {{ request.page_type | json }},   // "index", "collection", "product"
      lcp_ms: Math.round(value),
      rating,                                      // good / needs-improvement / poor
      lcp_element: a.target,                       // CSS selector of the measured element
      ttfb_ms: Math.round(a.timeToFirstByte),
      load_delay_ms: Math.round(a.resourceLoadDelay),
      load_time_ms: Math.round(a.resourceLoadDuration),
      render_delay_ms: Math.round(a.elementRenderDelay),
    };
    if (window.gtag) {
      gtag('event', 'lcp_debug', data);
    } else if (window.Shopify && Shopify.analytics) {
      // If GA4 runs through Shopify's Google app (a sandbox), gtag isn't available here.
      // Publish a custom event and forward it from a custom pixel (Settings > Customer events).
      Shopify.analytics.publish('lcp_debug', data);
    }
  });
</script>

In GA4, register page_type, lcp_element and the four breakdown fields as custom dimensions or metrics, so you can report on them. You can also upload the web-vitals file to your theme's assets folder instead of loading it from unpkg.

4. Top sections: no entrance animation (position-based, so weekly reorders can't break it)

Put this at the top of each image, banner or slideshow section file:

{%- liquid
  # Sections in position 1-2 of the page count as "top of page".
  # This uses the position, not the section type, so a weekly reorder is safe.
  assign is_top = false
  if section.index and section.index <= 2
    assign is_top = true
  endif
-%}

<div class="section-wrapper{% unless is_top %} reveal-on-scroll{% endunless %}">
  ...
</div>

5. Hero slider: slide 1 shows right away, with no lazy loading (sections/slideshow.liquid, guess)

{%- for block in section.blocks -%}
  {%- liquid
    assign img_loading = 'lazy'
    assign img_priority = 'auto'
    if forloop.first and is_top
      assign img_loading = 'eager'
    endif
    # Fix C3: turn this on ONLY if the re-test confirms slide 1 is the LCP element
    # if forloop.first and section.index == 1
    #   assign img_priority = 'high'
    # endif
  -%}
  <div class="slide">
    {{ block.settings.image
      | image_url: width: 2000
      | image_tag:
        loading: img_loading,
        fetchpriority: img_priority,
        widths: '400, 600, 800, 1100, 1500, 2000',
        sizes: '100vw',
        alt: block.settings.image.alt
    }}
  </div>
{%- endfor -%}

image_tag adds width and height automatically, which prevents layout shifts.

CSS, if your theme has no setting to turn off the fade:

/* Slide 1: no entrance fade (class names are guesses) */
.hero-slider .slide:first-child,
.hero-slider .slide:first-child img {
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  transition: none !important;
}
/* Before the slider script runs, show only slide 1.
   Use your slider's "ready" class: swiper-initialized, flickity-enabled, slick-initialized ... */
.hero-slider:not(.swiper-initialized) .slide:not(:first-child) {
  display: none;
}

6. Collection grid: first rows and promo banner (sections/main-collection-product-grid.liquid, guess)

{%- liquid
  # How many products show before the promo banner (from the block setting)
  assign promo = section.blocks | where: 'type', 'promo_banner' | first
  assign promo_after = promo.settings.show_after | default: 99
  assign promo_loading = 'lazy'
  assign promo_priority = 'auto'
  if promo_after <= 4
    assign promo_loading = 'eager'
    # The banner is the confirmed LCP element in PageSpeed Insights.
    # Keep 'high' only if the re-test after C1 + C2 still shows the banner as LCP.
    assign promo_priority = 'high'
  endif
-%}

{%- for product in collection.products -%}
  {%- liquid
    # First 2 rows on mobile (2 per row) = 4 products: load right away
    assign card_loading = 'lazy'
    if forloop.index <= 4
      assign card_loading = 'eager'
    endif
  -%}
  {% render 'card-product', card_product: product, image_loading: card_loading %}

  {%- if forloop.index == promo_after -%}
    {% render 'promo-banner', block: promo, image_loading: promo_loading, image_priority: promo_priority %}
  {%- endif -%}
{%- endfor -%}

Inside snippets/promo-banner.liquid. Also leave out any reveal animation class when image_loading == 'eager'.

{{ block.settings.image
  | image_url: width: 1600
  | image_tag:
    loading: image_loading,
    fetchpriority: image_priority,
    widths: '400, 600, 800, 1200, 1600',
    sizes: '(min-width: 990px) 1200px, calc(100vw - 32px)',
    alt: block.settings.image.alt
}}

Make sure card-product passes image_loading into its own image_tag loading: value.

7. Product gallery: first image only (use after Step 1 confirms it's the LCP element)

{%- for media in product.media -%}
  {%- liquid
    assign media_loading = 'lazy'
    assign media_priority = 'auto'
    if forloop.first
      assign media_loading = 'eager'   # on screen at load: never lazy
      assign media_priority = 'high'   # only because Step 1 confirmed it as the LCP element
    endif
  -%}
  {{ media.preview_image
    | image_url: width: 1500
    | image_tag:
      loading: media_loading,
      fetchpriority: media_priority,
      widths: '400, 600, 800, 1100, 1500',
      sizes: '(min-width: 990px) 50vw, 100vw',
      alt: media.alt
  }}
{%- endfor -%}

If your theme shows the selected variant's image first, apply this to that image instead of forloop.first.

8. Preload: only if the confirmed LCP image is a CSS background or added by JS

The better fix is to change the background into an <img> with image_tag. If you can't, add this to that section:

<link rel="preload" as="image" fetchpriority="high"
  href="{{ section.settings.image | image_url: width: 800 }}"
  imagesrcset="{{ section.settings.image | image_url: width: 400 }} 400w,
               {{ section.settings.image | image_url: width: 800 }} 800w,
               {{ section.settings.image | image_url: width: 1400 }} 1400w"
  imagesizes="100vw">

9. Stop scripts from blocking the page (theme.liquid and section files)

{%- comment -%} Before: the page waits for this script to download and run {%- endcomment -%}
{{ 'slider.js' | asset_url | script_tag }}

{%- comment -%} After: downloads alongside the page, runs after the HTML is ready {%- endcomment -%}
<script src="{{ 'slider.js' | asset_url }}" defer></script>

Verify plan with timeline

Lab rule for every change: Make one change at a time. Test it on the duplicate theme with Lighthouse in DevTools (mobile, Incognito), 3 runs, and use the middle result. Run Snippets 1 and 2, and check that CLS stays at 0.1 or less. Then publish, and run PageSpeed Insights mobile 3 times on the live URLs.

WhenWhat to doPass if
Day 0Add Snippet 3 (field tracking). Record the baseline: PageSpeed Insights mobile, 3 runs each, on /, /collections/indoor-plants/, one more collection, /products/monstera-deliciosa-large/ and one more product. Note the LCP element and breakdown for each. Save the CrUX numbers (top of PageSpeed Insights) and the Search Console Core Web Vitals mobile groups. Duplicate the theme.Baseline saved
Days 1–3Fixes C1 → C2, lab test after each. Then re-confirm the LCP element and do C3 (fetchpriority on that one image). Then C4, C5 and P1–P4. Publish.Lab mobile LCP of 2.0–2.5 s or less on collection pages (guess). The LCP element is the one you expect. No image on screen is lazy.
Day 3In Search Console, open the failing mobile LCP group and click Validate fix. Validation watches the next 28 days.Validation started
Days 3–10First field read from Snippet 3, by page type. Needs a few hundred visits per page type (guess).Mobile p75 falling toward 2.5 s. lcp_element in the field matches the lab.
Weeks 2–3Deeper fixes D1, D2, D4, D6, lab test after eachTTFB 0.6 s or less in lab, render delay 0.2 s or less
Day 28 after the last big changeCrUX uses a rolling 28-day window, so only now does it reflect the new code fully. Check PageSpeed Insights field data and Search Console. Expect them to differ a little, because they group and measure data differently.Mobile LCP p75 of 2.5 s or less. Search Console groups move to "Good".
Every week, after the merchandiser reorders2-minute check: PageSpeed Insights mobile on one collection URL, plus Snippet 2. Also watch lcp_element in your Snippet 3 data.LCP element unchanged, no lazy images on screen. If the element changed, repeat C3 for the new element.
Day 28 onwardCompare mobile conversion rate on collection and product pages, before and after, in Shopify Analytics. Core Web Vitals are only a small ranking factor. The bigger win is user experience and sales.Mobile conversion holds or rises

Send me the PageSpeed Insights mobile results (LCP element and breakdown) for your home and product pages. Then I'll replace my guesses in those rows with confirmed fixes.

Lines like “check: pass” or “fixed” are the model talking to itself. The prompt tells it to review its own work before answering; that review is part of the output.

The prompt

First lines open so you can see how it is built. The rest opens after purchase.

the prompt · 592 words7 sections
#ROLE
You are a web performance expert specializing in Largest Contentful Paint (LCP). Help me find what really slows my LCP and fix it.

#INPUTS
Fill in every line. Leave a line blank if you don't know it.
- Website: [WEBSITE URL]
- Platform and theme: [e.g., Shopify Dawn, WordPress + Elementor, Next.js]
- Page types failing LCP and example URLs: [e.g., home, category, product, blog post]
Full prompt opens after purchase
Sections inside: #ROLE #INPUTS #FACTS #PROCESS #OUTPUT FORMAT #RULES #QUALITY CHECK

How to use it

  1. Buy, then open it in your account.
  2. Copy the prompt into ChatGPT, Claude or Gemini.
  3. Replace the 6 inputs with your product.
  4. Run it. Use the output. Re-run with a different tone if you like.

Pro tips

  • Find the real LCP element on each page type first. Teams often fix the hero image while the browser measures something else.
  • Remove lazy loading and fade-in effects from anything at the top of the page. That alone often fixes LCP.
  • Judge results on field data over 28 days, not one lab test.

Before you buy

Will it work for my product?
Yes, if you can fill the 6 inputs. If the output is bad with your inputs, email us: we fix the prompt and refund you.
Do I download a file?
No. It lives in your account with a copy button, and updates when we improve it.
Which model is best?
Best on Claude. Works in ChatGPT, Claude and Gemini.

Works well with this

Prompts people use in the same campaign.

More in Page Speed & Core Web Vitals

See all in this sub-category

Buying more than two? Lifetime is cheaper.

Every prompt, every category, forever. $59 once. Nothing to download, nothing to renew.

Get lifetime · $59

This prompt

$3$7

  • ✓ Instant access in your account, with a copy button
  • ✓ Example input and real output included
  • ✓ 7-day money-back, no form

Or get every prompt, forever

Lifetime Access · $59 $149 — all categories, all future prompts, rewrites included.

Get lifetime access

Card or PayPal · taxes at checkout · nothing to download

Not the one you need?

Browse every prompt by category and sub-category.

Browse all prompts
Lifetime $59 →