Check 16.08 · Images and multimodal search

Lazy-load offscreen images

Defer offscreen images without hiding them from Google Images: real src in the HTML, native lazy loading, well-configured plugins and a check of the rendering.

Priority
Important
Difficulty
Easy
Estimated time
30 min to 2 h
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

Lazy loading only downloads an image when the visitor gets close to it. Done well, it lightens the initial load without taking anything away from indexing. Done badly, it replaces the image's URL with a placeholder and makes it invisible to Google Images. The task is to check that every deferred image keeps its real URL in the src attribute (or in the rendered HTML), to favor the native loading="lazy" attribute and to configure the plugins and themes that add their own mechanism.

Why it matters

For performance, the rule is well known: everything below the first screen is deferred, nothing in the first screen is. It is detailed in lazy-load offscreen content (opens in a new tab). This guide covers the other side: the visibility of deferred images in search.

Google states that its crawlers do not scroll the page or interact with it. It accepts three techniques: the browser's native lazy loading, the IntersectionObserver API and libraries that load content when it enters the viewport. An image whose loading waits for a scroll, a click or a hover never appears in the HTML rendered by Google.

The second trap is more subtle. Many lazy loading scripts write:

<img src="data:image/gif;base64,R0lGOD…" data-src="/images/atelier.jpg" alt="…">

In the source HTML, the only real image URL is in data-src, an attribute Google does not read as an image. Everything then depends on the script running during rendering. Google says it indexes images referenced in the src attribute of an <img>; it documents nothing for data-src.

With loading="lazy", the real URL stays in src from the source HTML onwards: the crawler finds it without running any script, and the browser handles deferring the download on its own. This is the safest solution.

What it improves

  • Indexing of deferred images Google Images, and tools that read HTML without running JavaScript, find the real URL.
  • Initial load and LCP (Largest Contentful Paint): fewer competing requests, provided the main image is spared.
  • Robustness Images display even if a script fails.
  • Rankings No direct effect. The point is to avoid losing visibility in Google Images.

How to check

1. The source HTML. Images must carry their real URL in src:

curl -s https://example.com/page/ | grep -o -i -E '<img[^>]+>' | grep -i -E 'data-(lazy-)?src|src="data:' | head

No lines: compliant. Lines with src="data:…" and data-src: a lazy loading script hides the URLs in the source HTML.

2. The HTML rendered by Google. In Search Console, URL Inspection tool, test the live URL, then open the rendered HTML. Look for the images at the bottom of the page: they must appear there with their real URL in src. If they are still in data-src, Google does not see them as images of the page.

3. Deferred images in the browser. Without scrolling, in the console:

console.table([...document.images].map((img) => ({
  file: (img.getAttribute('src') || '').slice(0, 50),
  dataSrc: img.dataset.src || img.dataset.lazySrc || '',
  loading: img.loading,
  inFirstScreen: img.getBoundingClientRect().top < window.innerHeight,
})));

Compliant: loading is lazy outside the first screen, eager (the default value) in the first screen, and the file column contains a real URL everywhere.

4. Site-wide. In Screaming Frog, compare a crawl without JavaScript rendering and a crawl with rendering: images found only in the second depend on a script.

How to implement

Before you start

Target markup for an offscreen image:

<img src="/images/atelier-800.webp" srcset="/images/atelier-400.webp 400w, /images/atelier-800.webp 800w"
     sizes="(min-width: 800px) 800px, 100vw" width="800" height="533"
     alt="TIG welding station in the workshop" loading="lazy" decoding="async">

Rules for visibility:

  • The real URL in src, not a placeholder image. Add width and height to reserve the space (set width/height (opens in a new tab)).
  • No lazy loading on the main image or on first-screen images. See optimize key images (opens in a new tab).
  • No click-to-load for images you want indexed: a gallery that only inserts the photos when opened, a “see more photos” button that calls an API. Put the <img> tags in the HTML, even if that means hiding them visually in a carousel.
  • Infinite scroll: images on subsequent “pages” must also be reachable through paginated, linked URLs.
  • Important images that are hard to expose otherwise: declare them in an image sitemap (opens in a new tab), which helps Google discover images it might miss.

If you must keep a JavaScript library (backgrounds, fade-in effects), check that it relies on IntersectionObserver and not on the scroll event, and check the rendered HTML. A <noscript> containing the image serves visitors without JavaScript; Google does not document its use for image indexing, so do not rely on it.

WordPress

Versions WordPress 6.4 to 7.1; WP Rocket 3.x.

WordPress adds native loading="lazy" to content images that have dimensions, sparing the first ones, without touching src. The risk comes from plugins that replace this mechanism with a script:

  • WP Rocket (Media > LazyLoad): by default, its script puts the URL in data-lazy-src. To go back to native lazy loading, which keeps the URL in src:
add_filter('rocket_use_native_lazyload_images', '__return_true');
  • LiteSpeed Cache (Page Optimization > Media Settings), Perfmatters, Autoptimize, Smush, Jetpack: each offers its own lazy loading. If you enable it, check the source HTML and the rendered HTML as described above. Otherwise, disable it and let WordPress handle it.

Only one layer of lazy loading at a time. Purge the cache after each change.

Shopify

Versions Shopify Online Store 2.0 themes, all plans, November 2026.

The image_tag filter adds native loading="lazy" to images in sections lower down the page, with the real URL in src. Some older themes still use the lazysizes library (lazyload class, data-src attribute): search for data-src in the theme's templates (Online Store > Themes > Edit code) and replace those tags with image_tag.

PrestaShop

Versions PrestaShop 8 and 9 (Classic and Hummingbird themes).

The Classic and Hummingbird themes (shipped with PrestaShop 9) use native loading="lazy" on product thumbnails. Lazy loading modules from the add-ons marketplace often use data-src: after installation, check the source HTML of a category page and a product page. Prefer adding loading="lazy" in the theme's templates (templates/catalog/_partials/miniatures/product.tpl in Classic, product-image.tpl in the same folder with Hummingbird).

Magento

Versions Magento Open Source and Adobe Commerce 2.4 (up to 2.4.9), Luma theme.

Luma's catalog thumbnails carry native loading="lazy" in recent versions. Lazy loading extensions and some commercial themes replace it with a script: check the source HTML of category pages, especially on catalogs whose images matter in Google Images.

Drupal

Versions Drupal 10 and 11.

Drupal adds native loading="lazy" to images in fields whose dimensions are known; the setting is made per field in Manage display (“lazy” or “eager” loading). Contrib modules for script-based lazy loading (such as Lazy-load) are only useful for what the native attribute does not cover: in that case, check the rendered HTML.

Wix

Versions Wix and Squarespace, all plans, November 2026.

Automatic: Wix defers offscreen images itself, as does Squarespace. Check in Search Console's URL Inspection tool that your gallery images appear in the rendered HTML, especially for galleries that load photos on click.

Webflow

Versions Webflow, all plans, November 2026.

Each Image element has a loading setting, “Lazy” by default, which produces native loading="lazy" with the URL in src. Switch first-screen images to “Eager”. Native sliders and tabs keep their images in the HTML.

Laravel

Versions Laravel 11 to 13.

Write the native attribute in the views, rather than using a JavaScript library:

@foreach($photos as $photo)
    <img src="{{ $photo->url }}" width="{{ $photo->width }}" height="{{ $photo->height }}"
         alt="{{ $photo->alt }}" @if($loop->index >= 3) loading="lazy" decoding="async" @endif>
@endforeach

For a gallery paginated by Livewire or an API, keep classic pagination URLs (?page=2) linked in the HTML, so that photos on subsequent pages remain crawlable.

Next.js

Versions Next.js 15 and 16.

next/image uses native lazy loading by default, with the optimized image URL in src and srcset. Images are present in the server-rendered HTML, except in a client component displayed only after an interaction. For the first screen, pass loading="eager", or preload for the main image: since Next.js 16, preload replaces the priority property, which is now deprecated.

Nuxt

Versions Nuxt 4 with the @nuxt/image 2 module; same behavior in Nuxt 3 with @nuxt/image 1.

NuxtImg does not defer by default: add loading="lazy". Avoid wrapping a gallery in <ClientOnly>: its images would not appear in the server-rendered HTML.

Astro

Versions Astro 5 to 7.

The Image component produces native loading="lazy" by default, in static HTML. For an interactive gallery (a client:visible island), keep the <img> tags in the component's server rendering, and only add the behavior (zoom, navigation) with JavaScript.

Common mistakes

  • Placeholder image in src and real URL in data-src: the page depends on JavaScript rendering to expose its images.
  • Loading on scroll or on click: galleries and “see more” buttons whose photos Google never sees.
  • Two stacked mechanisms (native and plugin): images that flicker or do not display.
  • Lazy loading on the main image: delayed LCP.
  • Infinite scroll without paginated URLs: images beyond the first batch are not crawlable.
  • Testing only in the browser: everything displays after scrolling; it is the source HTML and the HTML rendered by Google that need checking.
  • Product images loaded afterwards by a recommendation API: in the eyes of search engines, they belong to no page.

Frequently asked questions

Does lazy loading prevent images from being indexed in Google Images?

No, if it is native or based on IntersectionObserver. With the loading="lazy" attribute, the image's real URL stays in the src attribute from the source HTML onwards, and Google finds it without scrolling anything. The risk comes from scripts that put the URL in data-src with a placeholder image, and from those that wait for a scroll or a click: Google does not interact with the page.

Do I need an image sitemap if my images are lazy-loaded?

Not necessarily. If deferred images keep their real URL in the src attribute, or appear in the rendered HTML checked with the URL Inspection tool, Google can discover them normally. An image sitemap is still useful as a complement for important images loaded by JavaScript, hosted on a CDN or hard to reach otherwise.

Does WP Rocket hide my images from Google?

Not necessarily: its script relies on IntersectionObserver, and Google renders the page. But it replaces the image's URL with a placeholder in the source HTML and puts it in data-lazy-src, which makes indexing dependent on JavaScript rendering. The rocket_use_native_lazyload_images filter lets you switch to native lazy loading, which keeps the URL in src. Then check the rendered HTML in Search Console.

How can I check that Google sees my deferred images?

In Search Console, inspect the URL, run the live test and open the rendered HTML. Look for the images at the bottom of the page: they must appear in an img tag with their real URL in the src attribute. If you only find a placeholder image or a data-src attribute there, the lazy loading mechanism is hiding these images.

Updated on

Topic checklist (PDF)

And now?

In the “Images and multimodal search” topic

  1. Use descriptive file names
  2. Write relevant ALT text without keyword stuffing
  3. Use WebP/AVIF if appropriate
  4. Compress images
  5. Size images appropriately
  6. Use srcset and sizes
  7. Set width/height
  8. Lazy-load offscreen images
  9. Optimize key images
  10. Add captions if relevant
  11. Use original images
  12. Provide textual context
  13. Allow crawler access
  14. Create an image sitemap if needed
  15. Fix broken images
  16. Check rights and credits
  17. Measure Google Images visibility
  18. Test multimodal searches