Lazy Loading Images: Speed Up Your Store Without Hurting Image Indexing

Lazy Loading Images: Speed Up Your Store Without Hurting Image Indexing

⏱ 18 min read

Images are the heaviest thing on almost every Shopify store. On the median web page they account for roughly 48% of total weight, and they are the Largest Contentful Paint element on about 85% of desktop pages and 76% of mobile pages, according to Web Almanac media data. That single fact tells you where your speed problem lives, and why lazy loading images is one of the highest-leverage fixes a merchant can ship.

Lazy loading defers off-screen images until a shopper is about to see them. Done right, it cuts the initial payload, frees early bandwidth for the content that renders first, and lifts Core Web Vitals. Done wrong, it does the opposite. It delays the one image Google measures for LCP, or it hides product images from the crawler so they never reach Google Images. This guide covers both failure modes and the exact way to defer images on Shopify safely, including how Shopify’s own image_tag filter behaves and how to confirm your images still get indexed.

Shopify collection page Lazy Loading product images progressively as a shopper scrolls on mobile

What Is Lazy Loading? The Short Answer

Lazy loading means the browser fetches a resource only when it is needed, instead of downloading everything the moment the page opens. The opposite is eager loading: fetch it right away. For images, lazy loading is now a single HTML attribute on the <img> tag, with no JavaScript required. A minimal lazy loading example:

<img src="product-800.webp" alt="Linen shirt in sand, front view"
     width="800" height="1000" loading="lazy">

The loading attribute takes two values. lazy defers the download until the image reaches a distance from the viewport that the browser calculates. eager is the browser’s default behaviour, and it has the same effect as leaving the attribute out. The browser decides how early a deferred image actually starts loading: according to web.dev, Chrome begins at roughly 1,250 pixels from the viewport on fast (4G) connections and about 2,500 pixels on slower (3G or worse) connections. These thresholds are built in and cannot be changed from your code (as of October 2026).

Three details that are easy to miss in practice:

  • It works on <img> and <iframe> only. CSS background images cannot be deferred with the attribute. Inside a <picture> element, put it on the fallback <img>.
  • Width and height belong with it. Without width and height, the browser treats images as 0×0 at first. That causes layout shift and can make a gallery load everything at once.
  • No JavaScript, no deferral. Images still load with JavaScript disabled, but the deferral only applies when JavaScript is enabled.

Does loading=”lazy” Work in Safari?

Yes. Native image lazy loading is supported across all major browsers: Chrome from version 77, Edge from 79, Firefox from 75 and Safari from 15.4. Support for iframes arrived later, in Firefox 121 and Safari 16.4 (as of October 2026, per web.dev). Older browsers simply ignore the attribute and load the image straight away, so nothing breaks.

What Lazy Loading Images Actually Does to Store Speed

Lazy loading tells the browser to skip fetching an image until it nears the viewport. With the native loading="lazy" attribute, the browser handles that decision for you, so fewer bytes compete for bandwidth during the first paint. The payoff scales with how image-heavy the page is. A median mobile page carries 13 <img> elements, rising to 56 at the 90th percentile, and a busy Shopify collection page can hold 20 to 60 product thumbnails at once.

Deferring the images below the fold means the browser spends its opening bandwidth on the hero and first-fold content, which is exactly what LCP measures. The win is real and still under-used: according to HTTP Archive, native lazy loading adoption climbed from about 25% of pages in June 2022 to about 35% by June 2024, so roughly two-thirds of sites leave the easiest performance gain on the table. On a store where images make up half the page weight, that is a direct improvement to both perceived speed and measured Core Web Vitals.

💡 Pro tip

Speed is not an abstract SEO metric here. Yottaa’s Web Performance Index for 2025, drawn from over 500 million eCommerce visits, found that cutting load time by one second raised mobile conversions by about 3%, and that third-party apps alone accounted for 44% of total load time. Lazy loading images buys back some of that budget.

Does Lazy Loading Hurt Image Indexing?

Correctly implemented, no. Google renders pages with an evergreen Chromium-based rendering service, then reads the image src and alt text from the rendered HTML. Deferred images still get discovered and still appear in Google Images. The risk is narrow and specific: it shows up only when an image loads in response to an action the crawler never performs.

Google’s position is blunt. In Google’s lazy-loading guide, updated in December 2025, the guidance is to load content whenever it is visible in the viewport and to avoid relying on user actions, “as Google Search does not interact with your page.” Alt text matters here too. Because the attribute stays in the HTML regardless of when the pixels load, every deferred product image still needs descriptive alt text. That is the textual signal that puts an image into image search, so it is not optional on a store that wants product images ranking. When deferred images stop appearing in Google Images despite correct alt text, a specialist Shopify SEO agency can trace whether the crawler is even seeing the rendered URL.

Why Scroll-Triggered Lazy Loading Hides Images From Google

This is the part most guides get wrong, including several that claim “Googlebot scrolls, so you are fine.” It does not scroll. Googlebot renders each page in a single pass at a tall viewport. It does not scroll, resize the window, or fire pointer events. That distinction decides whether a lazy loading method is safe.

Native loading="lazy" and the IntersectionObserver API both key off an element’s layout position relative to that render viewport, so below-fold images still resolve during rendering. Legacy techniques that swap a data-src value into src only when a scroll or resize event fires never trigger for the crawler. The real image URL never lands in the rendered src, and the image is treated as absent. The tell-tale sign is an <img> whose rendered src is still a 1×1 or blurred placeholder.

If you are stuck with an event-based script you cannot immediately remove, keep the real URL reachable without interaction: pair a placeholder src with a data-src, or add a <noscript> fallback carrying the original <img>. Treat that as a stopgap, not a fix. The clean solution is to stop depending on scroll events at all and let the browser or IntersectionObserver decide.

Native Loading vs IntersectionObserver vs JS Libraries

Three approaches dominate, and only one of them carries real indexing risk. The table below is the decision you actually make when auditing a theme.

MethodHow it triggersIndexing riskUse it for
Native loading=”lazy”Browser, on viewport proximityNoneThe default for almost every below-fold image
IntersectionObserverElement enters the render viewportNone, if it does not wait for a scrollAdvanced control, placeholders, background images
Scroll or resize event JSFires only on user interactionHigh, the crawler never scrollsNothing new, replace it
Old jQuery lazy pluginsUsually scroll-basedDepends on the triggerMigrate to native loading

Google’s own recommendation is to use browser built-in lazy loading or the IntersectionObserver API guide with a polyfill, and to reserve the observer for cases that need fine control. For most Shopify stores, native loading="lazy" is enough, and it is documented in the browser-level lazy loading reference. If your speed problem is deeper than image loading, a conversion rate optimisation review will usually surface where the real friction sits.

Chrome DevTools network panel filtered to images, showing requests firing progressively during scroll

Never Lazy-Load the LCP Image

This is the most common and most expensive lazy loading mistake, and it has nothing to do with indexing. Lazy-loading the hero delays the exact element LCP measures, so the metric you were trying to improve gets worse. HTTP Archive found that nearly one in ten LCP-responsible images still carry native lazy loading, an anti-pattern that measurably slows pages.

On Shopify this happens for a structural reason. Sections are reusable, so a banner that sits above the fold on the homepage might sit below it on another template, and a blanket lazy rule catches the hero by accident. The fix is two attributes on the first-fold image: loading="eager" so it is never deferred, and fetchpriority="high" so the browser pulls it before lower-priority requests.

The data explains why priority beats raw file size. In the Web Almanac performance chapter, pages with poor LCP spent 720 to 1290 milliseconds on image load delay, while the image download itself took only around 350 milliseconds. In other words, the hero was usually waiting in a queue, not downloading slowly. A good LCP is 2.5 seconds or less at the 75th percentile, and prioritising the hero is how you protect it. If you are unsure which element even counts as your LCP, identifying it per template is the first thing to check. Our guide on how to improve your Shopify LCP walks through finding that element and speeding it up without a theme rebuild.

🎯 If you only fix one thing

Make sure your hero image is not lazy-loaded. Give it loading="eager" and fetchpriority="high". This single change fixes the most common LCP failure on Shopify stores.

Lazy Loading vs Eager Loading: Which Image Gets What?

The base rule is simple: anything in the first viewport loads eagerly, everything below it loads lazily. One point worth knowing: loading="eager" does not make an image load faster than an image with no attribute at all, it only prevents deferral. Actual priority comes from fetchpriority, which takes high, low or auto (the default). Web.dev describes it as a hint to the browser, not a directive (as of October 2026).

Image on the storeloadingfetchpriorityNote
Hero banner or LCP imageeagerhighExactly one per template, optionally preloaded as well
First product image on the product pageeagerhighUsually the LCP element on mobile
Further gallery or slider slideslazylowWeb.dev recommends high for the first slide only and low for the rest
First row of a collection pageeagerautoHow many tiles are visible depends on the viewport, so check on mobile
Product tiles further downlazyautoThe default case that image_tag covers automatically
Header logoeagerautoSmall and instantly visible, never defer it
Footer icons, payment logoseager or inline SVGautoLazy loading tiny files gains nothing, inline SVG saves the request

Combining loading="lazy" with fetchpriority="high" is rarely useful: the image stays deferred while it is off-screen and only gets high priority after that. fetchpriority is now widely supported too, in Chrome and Edge from version 102, Firefox from 132 and Safari from 17.2. The web.dev Fetch Priority guide has the details.

How Shopify Handles Lazy Loading by Default

Modern Online Store 2.0 themes, including Dawn, Craft, Sense, and Refresh, ship with loading="lazy" on below-fold images already. Shopify’s image_tag Liquid filter goes further: it sets the loading attribute to lazy by default for images in sections further down the page, and it outputs width and height automatically. Those dimensions matter, because they reserve space and stop the layout shift that would otherwise hurt CLS.

There are two catches worth knowing before you trust the default. First, because sections are reusable, image_tag can still guess wrong and lazy-load an image that happens to be your hero on a given template. Second, image_tag will not override a loading value you have already set by hand, so a hardcoded loading="lazy" buried in a section file quietly defeats the smart default. Shopify documents the recommended approach in its Shopify performance best practices, and it is worth reading before editing theme code.

Shopify Liquid image_tag: loading, eager, lazy and preload: true

For the most important image on a template, the filter has its own parameter. According to Shopify’s image_tag filter documentation, preload: true sends a Link HTTP header with rel=preload and as=image. If the tag has a srcset or sizes, the matching values go into the header too, so the browser learns about the hero early. When you do not use preload, the filter sets loading="lazy" automatically for images further down the page, and by default it generates a srcset with a sensible set of widths up to the maximum width defined in the image URL (as of October 2026).

<!-- Hero with a preload header: one image per template only -->
{%- if section.index == 1 -%}
  {{ section.settings.hero | image_url: width: 1600 | image_tag: preload: true, fetchpriority: 'high', sizes: '100vw' }}
{%- else -%}
  {{ section.settings.hero | image_url: width: 1600 | image_tag: loading: 'lazy', sizes: '100vw' }}
{%- endif -%}

Shopify recommends using preload sparingly, for example for above-the-fold images. Every extra preload competes for the same early bandwidth. Use section.index (and section.location if you need it) to decide whether a section is the first one in the template. Any other HTML attribute, such as fetchpriority or class, you pass to image_tag as a parameter with the same name.

📌 Good to know

Shopify’s Web Performance Dashboard and the Theme Check tool both flag loading and rendering issues at the theme level, including parser-blocking scripts and oversized bundles. Use them before assuming images are the whole problem, because INP failures on Shopify are almost always JavaScript, not images.

How to Add Lazy Loading Correctly on Shopify

The goal is simple: defer everything below the fold, prioritise everything above it, and never depend on a scroll. Here is the sequence for a theme you control.

  1. Confirm what the theme already does. Right-click a below-fold image, choose Inspect, and look for loading="lazy". If it is there and you did not add it, leave it alone and do not stack an app on top.
  2. Defer below-fold images with the filter. Use image_tag with an explicit lazy value in custom sections rather than a JavaScript library.
  3. Force the hero to load eagerly. On the first-fold image, set eager loading and high fetch priority so LCP is protected.
  4. Let reusable sections decide with section.index. This lets one section behave correctly whether it renders first or fifth.
  5. Serve the right size. Add srcset and sizes so the browser never downloads a 2000px file into an 800px slot. Shopify’s CDN resizes on the fly through URL parameters.
  6. Keep dimensions on every image. image_tag adds width and height for you, which holds CLS near zero.
<!-- Below-the-fold image: defer it -->
{{ product.featured_image | image_url: width: 800 | image_tag: loading: 'lazy', widths: '400, 600, 800, 1200' }}

<!-- Hero / first-fold image: prioritise it -->
{{ section.settings.hero | image_url: width: 1600 | image_tag: loading: 'eager', fetchpriority: 'high', widths: '800, 1200, 1600' }}

One nuance for advanced setups: add decoding="async" to the same below-the-fold images you already lazy-load, inside the image_tag call next to loading: 'lazy'. It lets the browser decode those images off the main thread, which can smooth INP on image-heavy pages. Leave it off the hero, which you want decoded immediately. It does not replace lazy loading, it complements it.

Lazy Loading Background Images, Videos and Iframes

The loading attribute covers only part of the heavy media on a store. Background images, product videos and embeds follow their own rules.

CSS background images

There is no native lazy loading for an image set through background-image. You have two clean options. The better one on Shopify is to replace the background with a real <img> rendered through image_tag and position it behind the text with object-fit: cover. You then get srcset, dimensions, lazy loading and alt text, and the image becomes visible to image search. Alternatively, an IntersectionObserver can add a CSS class with the background image just before the container enters the viewport. If the background image is your LCP element, do not defer it at all: preload it with fetchpriority="high", as web.dev recommends for CSS backgrounds.

Product videos and animated GIFs

Videos that do not autoplay get preload="none" and a poster image. The browser then downloads no video data until someone taps play, and the poster holds the space. If a video is the largest element in the first viewport, do not lazy-load it, give the poster image high priority instead. For animated GIFs, a muted, looping video (autoplay muted loop playsinline) usually achieves the same effect at a far smaller size, and an IntersectionObserver can start it only when it scrolls into view.

Iframes: YouTube, maps and review widgets

YouTube embeds, maps and iframe widgets often carry heavy JavaScript. For below-fold iframes, loading="lazy" on the <iframe> tag is enough, since the attribute is standardised for iframes. Leaner still is a facade: a preview image with a play button appears first, and the real player loads only on click.

Google Search Console URL Inspection tool showing rendered HTML with image src attributes populated

How to Verify Images Still Get Indexed

Implementation is half the work. Verification is the half most teams skip, and it is where indexing problems get caught before they cost rankings.

  • Check the rendered HTML. Use the URL Inspection Tool in Search Console, run a live test, and open the rendered HTML. If your image URLs appear in the src attribute of the <img> elements, the setup works. This is Google’s own recommended test.
  • Watch the network waterfall. In Chrome DevTools, open the Network tab, filter by Img, and scroll slowly. Requests should appear progressively as you approach each image, not all at once. If everything loads immediately, lazy loading is not actually firing.
  • Confirm the LCP element. Run PageSpeed Insights or Lighthouse and read the LCP audit. If it flags that the largest contentful paint image was lazily loaded, your hero rule is wrong.
  • Submit an image sitemap. It is cheap insurance that helps Google discover product images even on deep or slow-crawled pages.

Measure the Impact: Shopify Web Performance Reports and Core Web Vitals

Only field data shows whether a change helps real shoppers, not a single Lighthouse run. Shopify shows a Core Web Vitals summary under Online Store > Themes and detailed reports under Analytics > Reports, broken down by time, URL and page type. The summary is based on real user data from the last 30 days, new data can take up to 36 hours to appear, and there is no data while the store is password protected (as of October 2026, per the Shopify Help Center). At the 75th percentile, a good score means an LCP of 2.5 seconds or less, an INP of 200 milliseconds or less and a CLS of 0.1 or less. Record the values per page type before the change and compare a few weeks later. A full Core Web Vitals checklist for Shopify helps you clear the remaining bottlenecks in the same round.

Common Lazy Loading Mistakes That Cost You Speed or Indexing

Most lazy loading problems trace back to the same short list. Each one has a clear cost and a clear fix.

MistakeWhat it costsFix
Lazy-loading the heroSlower LCP, the exact metric Google measuresForce loading eager plus fetchpriority high
Scroll or click triggered loadingImages drop out of the indexSwitch to native loading or IntersectionObserver
Missing width and heightLayout shift and worse CLSKeep dimensions, image_tag adds them for you
Double lazy loadingA broken src the crawler cannot readRemove the app or the manual attribute
Deferring tiny assetsOverhead with no speed gainLoad icons and 1×1 pixels eagerly
Hiding heavy images behind lazy loadingThe bytes still land, just laterCompress and serve WebP or AVIF first
Forgetting alt textNo textual signal for image searchAdd descriptive alt to every product image
⚠️ Warning

If you run a speed app and a modern theme together, check for duplicated loading attributes and for an app rewriting src into data-src. Stacking two lazy loading systems is a frequent cause of images that render for shoppers but disappear from the rendered HTML Google sees.

Lazy Loading App or Theme Code: What Is Right for Your Store?

Many stores install a speed app to “enable lazy loading” when the theme already does it, and end up with exactly the stacked systems from the warning above. Answer three questions first:

  1. Does your theme already set loading="lazy"? On Online Store 2.0 themes that use image_tag, almost always yes, and an app then creates a problem.
  2. Does the app rewrite src into data-src? Check the rendered HTML in URL Inspection. If it shows only a placeholder, that is an indexing risk.
  3. What does the app load itself? A lazy loading app that adds more JavaScript than it saves in image weight is a net loss.

In most cases the lasting fix is a correction in theme code: one clean image_tag call per section, one hero rule per template and no extra dependency. We have a separate guide on how to replace a Shopify app with custom code step by step. If you are not sure which section renders first on which template, or where the LCP image sits, a speed audit with a per-template breakdown is worth doing before you touch the code. And if you bring in a Shopify agency for the work, ask to see the loading rules for each template, not just a single Lighthouse score.

Conclusion

Lazy loading images is not risky. Mis-applied lazy loading is. Two rules carry almost all of the value. Never defer the image that decides your LCP, and never make image loading depend on a scroll the crawler will not perform. Get those right, keep alt text on every product image, and lazy loading becomes what it should be: a straightforward speed gain that leaves your image indexing fully intact. Everything after that is verification in Search Console and DevTools, which takes minutes and prevents the expensive surprises.

Fixing lazy loading usually surfaces a deeper speed or indexing problem. Here is where we can help.

⚡

Shopify Speed Audit

We identify your LCP element per template and the exact loading rules slowing it down.

Find my LCP issue →
🛠️

Shopify Theme Development

We fix loading attributes and reusable sections at the code level, not with another app.

Fix my theme →
🔍

SEO Audit

We confirm your product images render in the crawler’s HTML and reach Google Images.

Audit my indexing →
FAQ

Frequently Asked Questions

Done correctly, it helps. Lazy loading below-fold images improves Core Web Vitals, which supports rankings. It only hurts SEO in two cases: when you defer the LCP hero image, or when images load on a scroll event the crawler never triggers. Avoid both and lazy loading is a net positive.

Yes, if they load on viewport visibility rather than user interaction. Google renders the page and reads the image src and alt text from the rendered HTML. Native loading and IntersectionObserver both work. Scroll-triggered scripts do not, because Google Search does not scroll or click your page.

No. The hero is usually your Largest Contentful Paint element, so deferring it directly slows the metric Google measures. Set loading to eager and add fetchpriority high on the first-fold image. Nearly one in ten LCP images across the web are still lazy-loaded by mistake.

Open a page with images below the fold, right-click a below-fold image, and choose Inspect. Look for loading equals lazy in the img tag. Modern themes like Dawn, Craft, and Sense include it by default. If it is there and you did not add it, do not add it again.

Loading lazy tells the browser to defer an image until it nears the viewport, which suits below-fold content. Loading eager forces the image to load immediately, which suits above-fold and hero images. Use eager plus fetchpriority high on the LCP image, and lazy on everything below the fold.

Usually not. Native browser lazy loading works everywhere, and Shopify’s image_tag filter applies it automatically for below-fold sections. Apps earn their place when you also want image compression, script deferral, or video facades without touching code. Reach for native loading first, then add a well-reviewed app only if you need extra features.

Because the images have no width and height, so the browser cannot reserve space and content jumps when they load. Add width and height attributes or an aspect-ratio value on every image. Shopify’s image_tag filter outputs these dimensions automatically, so prefer it over raw img tags.

Use Shopify’s image_tag filter, which sets lazy loading by default for images in sections further down the page. For the hero and first-fold images, override it with loading eager or use preload: true. This keeps above-fold content fast while deferring everything the shopper has not scrolled to yet.

Lazy loading means the browser only fetches an image or iframe when it gets close to the visible part of the page, instead of downloading everything on page load. For images, adding loading=”lazy” to the img tag is enough. The opposite is eager loading, which is the right choice for images in the first viewport.

Add loading=”lazy” to the img tag, together with width and height so the browser can reserve space. Use it only for images outside the first viewport and leave the hero or LCP image eager, ideally with fetchpriority=”high”. On Shopify, the image_tag filter adds lazy loading for images further down the page automatically.

Not with the loading attribute, which only works on img and iframe tags. On Shopify it is usually better to replace the background with an img rendered through image_tag and object-fit: cover. Alternatively, an IntersectionObserver can add the CSS class with the image just before it enters the viewport. If the background is your LCP element, preload it instead of deferring it.