Free SEO audit for new clients — claim yours
Home/Blog/Technical SEO/Lazy Loading and SEO: Best Practices
Technical SEO

Lazy Loading and SEO: Best Practices

Lazy Loading and SEO: Best Practices
Table of contents
  1. Key Takeaways
  2. How Google Sees Lazy-Loaded Content
  3. Lazy Loading Methods Compared
  4. Do Not Lazy Load Your LCP Image
  5. Implementation: Step by Step
  6. Infinite Scroll and "Load More"
  7. Lazy Loading Video, Embeds and Other Content
  8. Common Mistakes
  9. How to Test Lazy Loading
  10. Related Guides
  11. Frequently Asked Questions
    1. Is lazy loading bad for SEO?
    2. Can Google index lazy-loaded images?
    3. Should I lazy load the first image on the page?
    4. Does WordPress lazy load images automatically?
    5. Does lazy loading help Core Web Vitals?
  12. Conclusion
  13. References

Lazy loading is one of the most effective ways to speed up image-heavy pages. Instead of downloading every image, video and embed as soon as the page opens, the browser waits until the user scrolls near them. Pages become lighter, faster and cheaper to serve, especially on mobile connections.

But lazy loading has two SEO risks. The first is visibility: if content only loads after scrolling or clicking, and search engines do not scroll or click, that content may never be indexed. The second is speed itself: lazy loading the wrong image, usually the large hero image at the top of the page, can make your Largest Contentful Paint slower rather than faster.

This guide explains how Google handles lazy-loaded content, which implementation to use, what never to lazy load, how to handle infinite scroll, and how to test that your setup works for both users and crawlers.

Key Takeaways

  • Use native loading="lazy" for images and iframes below the fold; it needs no JavaScript and is widely supported.
  • Never lazy load the LCP image or anything visible in the first viewport.
  • Content must load when it enters the viewport, not on scroll events or clicks, because Google does not interact with the page.
  • Always set width and height on lazy-loaded images to prevent layout shifts.
  • Infinite scroll needs paginated URLs with real links so every item is crawlable.

How Google Sees Lazy-Loaded Content

Google renders pages with a headless browser, but it does not behave like a person. It does not scroll down, click "load more" or hover over elements. Google's lazy-loading documentation says content should not rely on user actions such as scrolling or clicking to load, and asks you to load relevant content when it becomes visible in the viewport.

“make sure that your lazy-loading implementation loads all relevant content whenever it is visible in the viewport”

— Google Search Central, Fix lazy-loaded content

In practice, implementations based on the browser's native loading attribute or the IntersectionObserver API work, while scripts that wait for a scroll event can leave content invisible to crawlers. Our guide to how Googlebot works explains rendering in more detail, and our JavaScript SEO guide covers related problems.

Lazy Loading Methods Compared

MethodHow it worksSEO safetyNotes
Native loading="lazy"Browser defers offscreen images and iframesHighNo JavaScript; the real URL stays in src
IntersectionObserver scriptJavaScript loads content when it enters the viewportHigh if implemented correctlyUseful for background images and custom components
Scroll-event scriptLoads content when the user scrollsLowCrawlers do not scroll; replace it
Click to load ("load more", tabs)Content fetched after a clickLow unless backed by URLsProvide crawlable paginated URLs
Infinite scrollNew items appended as the user scrollsLow without paginationNeeds unique URLs for each chunk

Browser support for the native attribute is broad: web.dev lists Chrome 77+, Edge 79+, Firefox 75+ and Safari 15.4+, and browsers that do not support it simply ignore it.

Do Not Lazy Load Your LCP Image

Largest Contentful Paint measures how quickly the main content element, often a hero image, appears. If that image is lazy loaded, the browser waits until layout is calculated before fetching it, which delays LCP.

In an analysis published in 2022, the web.dev team examined this using HTTP Archive and Chrome UX Report data, and in a lab test on WordPress pages.

“Overall, websites that use lazy loading tend to have worse LCP performance.”

— web.dev, The performance effects of too much lazy loading

In that analysis, the median 75th-percentile LCP was 2,922 ms for pages without lazy loading and 3,546 ms for pages with it. The authors stress this is correlation rather than causation. In their lab test, simply not lazy loading above-the-fold images reversed the LCP regression while keeping the data savings for images further down the page. Our Core Web Vitals guide explains why LCP matters.

The rule is simple: images in the initial viewport load normally; consider fetchpriority="high" for the main hero image; lazy load everything below.

Implementation: Step by Step

  1. Identify above-the-fold content for both mobile and desktop layouts, including logos, hero images and the first product images in a grid.
  2. Load those eagerly. Remove loading="lazy" from them and prioritise the LCP image.
  3. Add loading="lazy" to images and iframes below the fold.
  4. Set width and height (or CSS aspect-ratio) on every image so space is reserved and layout does not shift.
  5. Keep real URLs in src. Avoid patterns where the only image URL sits in a data-src attribute.
  6. Replace scroll-event scripts with native lazy loading or IntersectionObserver.
  7. Back up infinite scroll and "load more" with pagination that uses unique URLs and <a href> links.
  8. Test rendering and performance with URL Inspection, Lighthouse and field data.

A typical setup:

<!-- Hero / LCP image: load eagerly and prioritise -->
<img src="hero-1200.webp" width="1200" height="600"
     alt="Team planning a website launch" fetchpriority="high">

<!-- Below-the-fold images: native lazy loading -->
<img src="chart-800.webp" width="800" height="450"
     alt="Organic traffic growth chart" loading="lazy">

<!-- Embedded video below the fold -->
<iframe src="https://www.youtube.com/embed/VIDEO_ID" width="560" height="315"
        title="Product walkthrough" loading="lazy"></iframe>

And a pattern to avoid:

<!-- Risky: the real image URL is only in data-src.
     If the script fails or never runs, there is no image. -->
<img class="lazy" data-src="product-photo.jpg" alt="Blue running shoe">

<!-- Safer: real src in the HTML, native lazy loading -->
<img src="product-photo.jpg" width="600" height="600"
     alt="Blue running shoe" loading="lazy">

Our image SEO guide covers file names, alt text and formats for these images.

Infinite Scroll and "Load More"

Infinite scroll is lazy loading applied to entire lists. Google's documentation asks sites that use it to support paginated loading, giving each chunk its own persistent, unique URL, so crawlers can reach every item without scrolling. Link those pages with standard anchors, as described in our pagination SEO guide. Content hidden in tabs and accordions is a related but different case; see our post on tabbed content and SEO.

Lazy Loading Video, Embeds and Other Content

  • YouTube and other iframes: loading="lazy" works on iframes; or use a lightweight facade (a thumbnail that loads the player on click) for embeds far down the page. If you want the video itself to be indexed, make sure Google can still find the video URL and a thumbnail; see our video SEO guide.
  • CSS background images: these do not support the loading attribute. Use IntersectionObserver to add a class when the element enters the viewport, and never put essential content only in a background image.
  • Text content and reviews: avoid lazy loading important text. If reviews or descriptions load late via API calls, make sure they load without interaction or render them on the server.
  • Images in JavaScript frameworks: framework image components often lazy load by default; mark the hero image as priority. See our headless CMS SEO and server-side rendering guides.

Common Mistakes

MistakeImpactFix
Lazy loading the hero imageSlower LCPLoad it eagerly, add fetchpriority="high"
Plugin lazy loads every imageAbove-the-fold images delayedExclude the first images or configure a threshold
Missing width and heightLayout shifts (CLS)Set dimensions or aspect-ratio
Scroll-triggered loading scriptsContent unseen by crawlersNative lazy loading or IntersectionObserver
Image URL only in data-srcImages not indexed if script failsKeep the real URL in src
Infinite scroll with no paginated URLsDeep items never discoveredUnique URLs and crawlable links

How to Test Lazy Loading

  • Run URL Inspection in Search Console and check that lazy-loaded images and content appear in the rendered HTML.
  • Use Lighthouse or PageSpeed Insights; it flags a lazy-loaded LCP image and images without dimensions.
  • Check field data in the Core Web Vitals report after changes, since lab tests do not reflect every device.
  • Crawl the site with JavaScript rendering on and confirm image URLs are discovered.
  • Test on a slow mobile connection to see how quickly below-the-fold images appear as you scroll.

For broader speed work, see how to improve page speed.

Frequently Asked Questions

Is lazy loading bad for SEO?

No, when it is done correctly. Native lazy loading and viewport-based loading are fine for Google. Problems come from loading content only on scroll or click and from lazy loading above-the-fold images.

Can Google index lazy-loaded images?

Yes, if the image loads when it enters the viewport and its URL is available in the rendered HTML, ideally in the src attribute.

Should I lazy load the first image on the page?

No. Images visible on first load, especially the LCP image, should load eagerly. Lazy loading them can slow Largest Contentful Paint.

Does WordPress lazy load images automatically?

Recent WordPress versions add native lazy loading to images and try to skip the first content images. Check your theme and plugins so the hero image is not lazy loaded.

Does lazy loading help Core Web Vitals?

It reduces data and can help overall speed, but it does not directly improve LCP; misapplied, it hurts LCP. Combine it with image dimensions to protect CLS.

Conclusion

Lazy loading is good for SEO when it is applied to the right content in the right way: native or viewport-based loading for below-the-fold media, eager loading for anything in the first screen, real URLs in the HTML and paginated fallbacks for infinite lists. Get those details right and you keep the speed benefits without hiding content from Google. If you would like an expert to tune your images and Core Web Vitals, see our page speed optimization service or request a free quote.

References

  1. Google Search Central: Fix lazy-loaded content
  2. web.dev: Browser-level image lazy loading for the web
  3. web.dev: The performance effects of too much lazy loading
  4. Google Search Central: Understand JavaScript SEO basics
  5. Semrush: Image SEO: How to Optimize Images for Search Engines & Users
Rohit Choudhary
Written byRohit ChoudharyCo-Founder, My SEO Experts

Rohit Choudhary is the co-founder of My SEO Experts and has more than 14 years of hands-on experience in SEO, paid advertising and digital marketing. Since starting out in 2011 he has helped hundreds of businesses grow through practical, data-driven search strategies, and he also serves as a consulting Digital Marketing Director for several US-based companies.

Keep reading

Related articles

Ready to grow your business online?

Get a free, no-obligation proposal tailored to your goals and budget.

CallFree Quote