LCP Fix · Updated August 2026

Shopify Hero Image Preload: Fix LCP with fetchpriority and Liquid (2026)

A slow Shopify LCP is often a hero image the browser discovers too late, lazy-loads by mistake, or downloads at the wrong size. Use Thunder’s free speed test first; Thunder clears the script bottlenecks around LCP, then this guide shows the exact Liquid preload pattern for the hero image itself.

~11 min read · Liquid preload snippets included

Quick Fix with Thunder

LCP is not just an image problem. The browser has to parse HTML, process CSS, run blocking scripts, discover the hero image, request it, decode it, and paint it. Thunder improves the parts around the image: script deferral, render-blocking reduction, and smarter loading order.

If PageSpeed says your LCP image has high load delay, combine Thunder with the manual preload below. For the full Core Web Vitals context, read our Shopify LCP optimization guide and Core Web Vitals guide.

Install Thunder

When Hero Image Preload Actually Helps

Largest Contentful Paint measures when the largest visible text or image element finishes rendering. Google’s good threshold is 2.5 seconds or less for at least 75% of real users. On Shopify homepages, landing pages, and collection pages, the LCP element is often the hero banner image.

Preload helps when the browser would otherwise discover that hero image late. This happens when the image URL is buried inside a section snippet, loaded through JavaScript, hidden behind responsive logic, or referenced after many CSS and script tags. Preload tells the browser: fetch this important image early.

Preload does not fix a 900KB image, a slider that waits for JavaScript, or render-blocking resources that delay the entire page. It is one part of the LCP chain. Use it with image compression, correct dimensions, and script cleanup.

Step 1: Confirm the LCP Element

Run PageSpeed Insights or Chrome DevTools Performance. In Lighthouse, expand the LCP diagnostic and check which element is reported. If it is the hero image, continue. If it is a headline or product image, preload that resource instead.

Do not guess. Shopify themes often show different hero assets on desktop and mobile, and sliders can make a different element win LCP on mobile. Our speed test results guide explains how to read the report without chasing the wrong metric.

Step 2: Preload the Exact Shopify Image URL

Add the preload link in theme.liquid inside the head, before heavy scripts. Use the same image object and width that your hero uses.

{%- if template.name == 'index' and settings.hero_image != blank -%}
  <link
    rel="preload"
    as="image"
    href="{{ settings.hero_image | image_url: width: 1600 }}"
    imagesrcset="
      {{ settings.hero_image | image_url: width: 800 }} 800w,
      {{ settings.hero_image | image_url: width: 1200 }} 1200w,
      {{ settings.hero_image | image_url: width: 1600 }} 1600w
    "
    imagesizes="100vw"
    fetchpriority="high"
  >
{%- endif -%}

The exact object name will differ by theme. It may be section.settings.image, settings.hero_image, or a block image. If the preload URL does not match the rendered image URL closely enough, the browser may download two images.

Step 3: Mark the Hero Image as Eager and High Priority

The image tag itself should not be lazy-loaded. Use eager loading and high fetch priority for the first above-the-fold hero image.

{{ section.settings.image
  | image_url: width: 1600
  | image_tag:
    widths: '800, 1200, 1600',
    sizes: '100vw',
    loading: 'eager',
    fetchpriority: 'high',
    alt: section.settings.heading
}}

Lazy-loading the hero is one of the most common Shopify LCP mistakes. Lazy loading is correct for below-the-fold product images and galleries; it is wrong for the one image the browser needs immediately. For the rest of your store, use our Shopify image optimization guide.

Step 4: Avoid the Responsive Image Double Download

If your preload points to a desktop image but mobile renders a separate mobile crop, mobile visitors may download the wrong preloaded file and then download the real mobile image. That makes LCP worse.

{%- assign hero = section.settings.mobile_image | default: section.settings.image -%}

<link
  rel="preload"
  as="image"
  href="{{ hero | image_url: width: 1200 }}"
  imagesrcset="{{ hero | image_url: width: 600 }} 600w, {{ hero | image_url: width: 1200 }} 1200w"
  imagesizes="100vw"
  fetchpriority="high"
>

For themes with truly different desktop and mobile hero images, use media-specific preload links carefully. Test both viewport sizes and check the Network tab for duplicate downloads.

Step 5: Be Careful with Sliders

Shopify Community LCP threads often point to hero slideshows as the hidden problem. Even with one visible slide, a slider may wait for JavaScript, initialize layout, hide images until ready, or preload multiple slides. Preloading one image cannot fully fix a hero that is controlled by a heavy carousel script.

For the first viewport, a static hero usually beats a slideshow. If you keep the slider, preload only the first visible slide, set it eager/high priority, lazy-load later slides, and remove autoplay JavaScript on mobile if it creates long tasks.

This is also where minimizing main-thread work matters. A carousel script can delay the image even when the image is requested early.

PageSpeed Says “LCP Image Was Lazily Loaded”? Use This Shopify Fix Path

This warning usually appears when a theme applies lazy loading to every image, including the first hero or slideshow image. The symptom is specific: PageSpeed identifies an above-the-fold image as the LCP element, then says it was lazy-loaded. Do not solve it by removing lazy loading from every image. Fix the first visible image only, then keep below-the-fold product grids, thumbnails, and later slides lazy.

Start with a fresh mobile test in the free Shopify speed test, then inspect PageSpeed’s “Largest Contentful Paint element” diagnostic. If the element is a slider image, banner, or main product image, follow the table below before editing unrelated app code.

SymptomLikely Shopify causeFix first
PSI says the LCP image was lazily loaded Theme image snippet applies loading="lazy" globally Add a first-image condition so only the above-the-fold hero uses eager/high priority
First slideshow image appears late Carousel hides the first slide until JavaScript initializes Render the first slide as a normal visible img, then lazy-load later slides
Preload exists, but LCP is still slow Preloaded desktop URL does not match the mobile image, or render-blocking JS/CSS delays paint Match the rendered mobile URL and run the Shopify analyzer for script/CSS bottlenecks
Main product image is the LCP element Product media gallery treats the first product image like a thumbnail or hidden slider item Make the first product image eager/high priority and avoid JavaScript-only rendering above the fold

Liquid pattern: lazy-load later slides, not the first slide

The exact variables depend on your theme, but the logic should happen while Liquid renders the image. A JavaScript patch that removes loading="lazy" after page load is too late for LCP because the browser already deprioritized the image.

{%- for block in section.blocks -%}
  {%- if forloop.first -%}
    {{ block.settings.image
      | image_url: width: 1600
      | image_tag:
        widths: '600, 900, 1200, 1600',
        sizes: '100vw',
        loading: 'eager',
        fetchpriority: 'high',
        alt: block.settings.heading
    }}
  {%- else -%}
    {{ block.settings.image
      | image_url: width: 1600
      | image_tag:
        widths: '600, 900, 1200, 1600',
        sizes: '100vw',
        loading: 'lazy',
        fetchpriority: 'auto',
        alt: block.settings.heading
    }}
  {%- endif -%}
{%- endfor -%}

If your theme uses a shared image snippet, pass a priority or is_lcp variable into that snippet instead of editing every section separately.

For merchants, the safe order is: duplicate the theme, change only the hero/slideshow/product-media template, test mobile, then compare the Network waterfall. If the LCP request starts early but the screen still stays blank, the blocker is probably render-blocking CSS, app JavaScript, or a heavy carousel script. Thunder can handle the common app-script and render-blocking side of that problem automatically; use the complete Shopify speed optimization guide for the manual path.

Manual Fix vs Thunder Fix

LCP issueManual fixThunder fix
Hero image discovered lateAdd exact preload link in theme.liquidImproves surrounding load order; theme preload may still be needed
Hero lazy-loadedSet loading eager and fetchpriority highHelps prevent non-critical work from delaying the hero
Blocking app scripts delay LCPAudit and defer each app scriptAutomatically defers non-critical app scripts
Oversized imageServe correct Shopify CDN width and compressWorks alongside image best practices for broader speed gains

Retest Without Fooling Yourself

After adding preload, open DevTools Network with cache disabled. Confirm the hero image starts early, confirm the rendered image is not downloaded twice, and compare mobile Lighthouse runs. Then watch real-user LCP in Shopify’s Web Performance dashboard or Search Console Core Web Vitals.

If the hero request starts early but LCP is still slow, the bottleneck is probably image weight, render-blocking CSS, or JavaScript. Use the complete Shopify speed optimization guide, then check whether PageSpeed also flags Shopify critical request chains, enormous network payloads, or Total Blocking Time. Compare Thunder’s optimization features, and check current plans if you want the automated path.

References and Validation

For the metric target, use web.dev's Largest Contentful Paint guidance: a good LCP is 2.5 seconds or faster at the 75th percentile. For priority hints, check web.dev's fetchpriority guidance; preload and fetchpriority solve different parts of the discovery and prioritization problem.

Shopify Community LCP threads often show the same failure mode: a merchant preloads a hero image and sees little movement because the theme is still lazy-loading it, the carousel script delays rendering, or render-blocking resources take priority. Validate the network waterfall, the rendered image URL, and the LCP element before declaring the preload ineffective. The fix is precise resource priority, not more preload tags.

Do It Yourself

Free plan · 1-click install · Instant results

Install Thunder Free →

Done For You

Core Web Vitals guarantee · 2-week delivery · 6 months Thunder free

Get Expert Optimization →

Starting from €1,500

FAQ

Should I preload my Shopify hero image?

Yes, if the hero image is the Largest Contentful Paint element and appears above the fold on initial load. Preload the exact image URL the browser will use, and combine it with fetchpriority='high' and loading='eager'.

Can preloading the wrong image hurt performance?

Yes. Preloading the wrong desktop image for mobile, preloading every slide in a carousel, or preloading images that are not visible above the fold wastes bandwidth and can delay the real LCP resource.

What is the best LCP target for Shopify?

Google’s good threshold for Largest Contentful Paint is 2.5 seconds or less at the 75th percentile of real users. Shopify stores should optimize the hero image, render-blocking scripts, fonts, and app loading to hit that target.

Does fetchpriority replace preload?

No. fetchpriority tells the browser how important an image is once it discovers it. Preload helps the browser discover the resource earlier. For important hero images, use both when the URL is stable.

Does Shopify automatically preload hero images?

Not reliably. Shopify’s CDN can resize and serve modern image formats, but your theme controls whether the hero image is eager-loaded, preloaded, lazy-loaded, or hidden inside a slider.

How do I fix the PageSpeed warning that my LCP image was lazily loaded?

First confirm the exact LCP element in PageSpeed Insights. Then edit the rendered hero, slideshow first slide, or product-media image so the initial image uses loading='eager' and fetchpriority='high'. Do this in Liquid before render, not with JavaScript after the image already loaded. Preload the same mobile/desktop URL the page actually renders, and keep later carousel slides lazy-loaded.

Can Thunder fix Shopify LCP automatically?

Thunder improves the surrounding bottlenecks that delay LCP, including render-blocking scripts, app JavaScript, and loading order. Theme-specific hero image markup may still need the manual preload and eager-loading changes in this guide.