Lazy-Load Images, Video, and Content Without Hiding Them From Google.

By · Published · Updated · About 8 min read

On this page (9)
  1. Know what lazy loading changes
  2. Understand the crawl limits
  3. Use native lazy loading first
  4. Add a fallback when you use JavaScript
  5. Defer video without losing it
  6. Give dynamic content a crawlable URL
  7. Protect Core Web Vitals
  8. Test that Googlebot still sees the content
  9. Avoid the common mistakes for lazy loading implementation without crawler visibility loss

A product page carries forty images, two video embeds, and a review list. The browser fetches all of it before the reader sees the first screen. The page is slow, so a developer adds a lazy-loading script. Two weeks later, the product images drop out of Google Images.

Lazy loading delays off-screen resources until the reader scrolls near them. It reduces the initial page weight and can improve load time. The method you choose decides whether Googlebot still sees the resource. This guide covers images, iframes, self-hosted video, and dynamic lists, with a test for each.

Know what lazy loading changes

Page speed affects rankings and conversion. Google measures page experience with Core Web Vitals: Largest Contentful Paint (LCP), Cumulative Layout Shift (CLS), and Interaction to Next Paint (INP). INP replaced First Input Delay (FID) as a Core Web Vital in March 2024. The Core Web Vitals developer guide covers each metric in depth.

Lazy loading helps in three ways:

The saving depends on how much of the page weight sits below the fold. Measure it on your own page in the browser Network panel before and after the change.

The risk is indexation. If a lazy-loading method hides a resource from Googlebot, Google does not index it. An image that exists only in a data-src attribute can disappear from Google Images.

Understand the crawl limits

Googlebot renders JavaScript and supports lazy loading. It still has limits:

For the rendering pipeline itself, read how Googlebot renders JavaScript.

Use native lazy loading first

Native lazy loading uses the HTML loading="lazy" attribute. All modern browsers support it, and Googlebot reads it.

Images

Add loading="lazy" to each image below the fold:

<img src="image.jpg" alt="description" loading="lazy" width="800" height="600">

The browser defers the fetch until the image is a set distance from the viewport. The browser chooses that distance. Googlebot reads the src attribute directly, so the image gets indexed as normal.

Apply three rules:

  1. Do not lazy-load an image that is visible on page load. Use loading="eager" or omit the attribute.
  2. Set width and height on every image, or set a CSS aspect-ratio. Missing dimensions cause layout shift.
  3. Combine lazy loading with srcset so each device gets an image of the correct size.
<img src="hero.jpg" alt="Hero image" loading="eager" width="1200" height="600">

<img
  src="image-800.jpg"
  srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
  sizes="(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px"
  alt="Product photo"
  loading="lazy"
  width="800"
  height="600">

The image optimization guide covers formats, compression, and alt text for the same images.

Iframes

Third-party embeds, such as YouTube videos and social widgets, accept the same attribute:

<iframe src="https://www.youtube.com/embed/VIDEO_ID" loading="lazy" width="560" height="315"></iframe>

Googlebot reads the src attribute, so Google still associates the video URL with your page. The performance gain is large. Each third-party iframe loads its own JavaScript and CSS, often 500 KB or more before the reader presses play.

Add a fallback when you use JavaScript

Some older browsers lack native lazy loading. A JavaScript method can fill that gap. It carries the highest SEO risk of any method in this guide.

Intersection Observer

The Intersection Observer API detects when an element enters the viewport. The usual pattern puts the image URL in data-src and copies it to src on entry.

<img data-src="image.jpg" alt="description" class="lazy" width="800" height="600">
document.addEventListener("DOMContentLoaded", function() {
  const lazyImages = document.querySelectorAll("img.lazy");

  const imageObserver = new IntersectionObserver((entries, observer) => {
    entries.forEach(entry => {
      if (entry.isIntersecting) {
        const img = entry.target;
        img.src = img.dataset.src;
        img.classList.remove("lazy");
        observer.unobserve(img);
      }
    });
  });

  lazyImages.forEach(image => imageObserver.observe(image));
});

Before the script runs, Googlebot sees an img element with no src attribute. The image may not get indexed. Add a noscript fallback that carries a real src:

<img data-src="image.jpg" alt="description" class="lazy" width="800" height="600">
<noscript>
  <img src="image.jpg" alt="description" width="800" height="600">
</noscript>

Libraries

Three common libraries do the same job:

Every one of them needs the noscript fallback for SEO safety.

Defer video without losing it

Video is the heaviest resource on most pages. A single file can weigh 10 to 50 MB.

For YouTube and Vimeo, use native iframe lazy loading, as shown above. The browser then defers the player script and the preview image until the reader scrolls to it.

For self-hosted video, show a poster image and load the video on click:

<div class="video-container" data-video-src="video.mp4">
  <img src="poster.jpg" alt="Video preview" class="video-poster">
  <button class="play-button">Play</button>
</div>
document.querySelectorAll('.video-container').forEach(container => {
  container.addEventListener('click', function() {
    const videoSrc = this.dataset.videoSrc;
    this.innerHTML = `<video controls autoplay><source src="${videoSrc}" type="video/mp4"></video>`;
  });
});

Googlebot indexes the poster image. To connect the video itself to the page, add VideoObject structured data. Put this object in a script element of type application/ld+json:

{
  "@context": "https://schema.org",
  "@type": "VideoObject",
  "name": "Video Title",
  "description": "Video description",
  "thumbnailUrl": "https://example.com/poster.jpg",
  "uploadDate": "2026-02-08",
  "contentUrl": "https://example.com/video.mp4"
}

For video rich results beyond this markup, see video SEO and search features.

Give dynamic content a crawlable URL

Infinite scroll and "Load more" buttons defer text and product lists, not only media. Each loaded section needs its own URL, or Googlebot cannot reach it.

Infinite scroll

Infinite scroll loads new items as the reader scrolls. It removes discrete pages, so the crawler has no "next page" to follow. Apply four rules:

  1. Give each section a paginated URL, such as /blog?page=2 or /blog/page/2/.
  2. Update the address bar with the History API as each section loads.
  3. Offer a paginated archive or a "View all" page that works without scroll.
  4. Link each paginated page to the next one with an ordinary a element.
window.history.pushState({}, '', '/blog?page=2');

You can also add rel="prev" and rel="next" link elements:

<link rel="prev" href="https://example.com/blog?page=1">
<link rel="next" href="https://example.com/blog?page=3">

Google stated in March 2019 that it no longer uses these link elements as an indexing signal. Other search engines and browsers can still read them. The crawlable a links do the work for Google.

"Load more" buttons

A "Load more" button reveals content on click. It is safer than infinite scroll, because the load is explicit. Googlebot does not click buttons, so it can still miss the content.

<div id="content-container"></div>
<button id="load-more">Load More</button>
document.getElementById('load-more').addEventListener('click', function() {
  fetch('/api/more-content')
    .then(response => response.text())
    .then(html => {
      document.getElementById('content-container').insertAdjacentHTML('beforeend', html);
    });
});

Give the same content a paginated URL, such as /page/2/, that loads without interaction. Then add a plain link to it:

<noscript>
  <a href="/blog?page=2">Load More Content</a>
</noscript>

Some guides suggest that you detect Googlebot and serve it pre-rendered HTML. Google now describes that pattern, dynamic rendering, as a workaround and not a long-term fix. Prefer server-side rendering or static pagination.

Protect Core Web Vitals

Lazy loading moves all three Core Web Vitals, in either direction.

LCP. LCP measures when the largest visible element renders. If you lazy-load that element, you delay it. Never lazy-load the hero image, the banner, or any image visible on page load.

<!-- Bad: delays the LCP element -->
<img src="hero.jpg" loading="lazy" alt="Hero image">

<!-- Good -->
<img src="hero.jpg" loading="eager" alt="Hero image" width="1200" height="600">

CLS. CLS measures unexpected layout movement. An image without dimensions pushes content down when it loads. Set width and height, or reserve the space in CSS:

img {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
}

INP. INP measures how fast the page responds to a click, tap, or key press. A heavy lazy-loading library can block the main thread and slow that response. Prefer native lazy loading. If you need a library, load it with async. Do not load it synchronously in the head.

Google uses Core Web Vitals as a page experience signal. A faster page also keeps more readers on it.

Test that Googlebot still sees the content

Run four checks after each lazy-loading change.

URL Inspection in Google Search Console:

  1. Enter the URL of a page with lazy-loaded images.
  2. Click Test live URL.
  3. Open the screenshot and the rendered HTML.
  4. Confirm that each image appears with a real src.

Screaming Frog SEO Spider:

  1. Set rendering to JavaScript under Configuration, Spider, Rendering.
  2. Crawl the site.
  3. Open the Images report.
  4. Confirm that lazy-loaded images appear with valid src attributes.

Rich Results Test. Google retired the Mobile-Friendly Test in December 2023. The Rich Results Test at https://search.google.com/test/rich-results still shows a rendered screenshot and the rendered HTML for a public URL.

Manual check:

  1. Disable JavaScript in your browser.
  2. Load each page type that uses lazy loading.
  3. Confirm that critical images and text appear through the noscript fallbacks.

Avoid the common mistakes for lazy loading implementation without crawler visibility loss

Five mistakes cause most lazy-loading damage:

Avoid the common mistakes
MistakeEffectFix
Lazy-load an image above the foldLCP gets worseUse loading="eager" on visible images
Use data-src with no noscript fallbackGoogle may not index the imageAdd a noscript image with a real src
Omit width and heightCLS gets worseSet dimensions or aspect-ratio
Load text with no URL structureCrawlers cannot reach the contentAdd paginated URLs and plain links
Lazy-load every image, small ones includedScript overhead for no gainLazy-load only images below the fold

The best default for SEO is native lazy loading with loading="lazy". It needs no JavaScript, Googlebot reads it, and every modern browser supports it. Use a script only when you need a behavior the attribute cannot give. Pair every script with a crawlable fallback.

Keep a record of lazy loading implementation without crawler visibility loss

Next steps for lazy loading implementation without crawler visibility loss

Topic map for lazy loading implementation without crawler visibility loss

Every page in this topic

  1. Decide whether AMP still earns its maintenance cost on your site
  2. Stop your code from creating duplicate URLs with canonicals, redirects, and clean routing
  3. Configure your CDN so crawlers get fresh pages and users get fast ones
  4. Run an SEO audit that fixes ranking barriers first and trivia last
  5. Trace each failing Core Web Vital to its root cause
  6. Instrument Core Web Vitals in production and block regressions in CI
  7. Apply code patterns that keep LCP, INP, and CLS inside Google's thresholds
  8. Build category pages that rank for the searches your shoppers start with
  9. Add Product, Offer, and Breadcrumb markup that makes your store eligible for rich results
  10. Control faceted navigation so filters help shoppers without flooding Google with URLs
  11. Fix your product page template so each product ranks for its buying searches
  12. Ship SEO fixes at the CDN edge when the backend cannot change
  13. Get engineering to ship your SEO fixes by writing them as engineering work
  14. Run seven SEO quick wins in 90 days to test organic search as a channel
  15. Split Google Search Console reports by role and act on each one
  16. Test how Googlebot renders your JavaScript site and close the indexing gaps
  17. Build SEO into a headless CMS so Google indexes every page
  18. Implement hreflang so each searcher lands on the right language version
  19. Choose the right HTTP status code for each URL and keep Google's index clean
  20. Optimize website images to speed up pages and rank in image search
  21. Notify search engines of new URLs with IndexNow and the Google Indexing API
  22. Set up international SEO so each market finds its own version of your site
  23. Plan international SEO as a product roadmap and launch markets in order
  24. Configure React, Vue, and Angular rendering so search engines index every page
  25. Fix JavaScript SEO so crawlers read your content without a render step
  26. Lazy-load images, video, and content without hiding them from Google
  27. Run Lighthouse in GitHub Actions to block SEO regressions before merge
  28. Read server logs to see what Googlebot crawls and stop wasted crawl budget
  29. Diagnose technical SEO problems and get engineering to fix them without writing code
  30. Design mobile-first pages that Google indexes in full and users can tap without errors

More in SEO by role

Neighboring topics

Services for this work