usdigitalmarketingindex.com SEO
How should image lazy loading work so Google can discover important images?
Updated November 15, 2026
Keep the image as a real image element with its URL in the src attribute, and let the browser or a viewport-based script decide when to fetch it. Loading must be triggered by the image coming into view, never by a user scrolling, clicking, or hovering as an event the page waits for. Google’s guidance states the requirement: “make sure that your lazy-loading implementation loads all relevant content whenever it is visible in the viewport”, and it explains why action-based triggers fail: “Google Search does not interact with your page” (Google’s guidance on lazy-loaded content). Images at the top of the page should not be lazy-loaded at all.
Native loading behavior
Browsers have lazy loading built in, through the loading attribute.
<img
src="/images/trail-runner-side.jpg"
alt="Side view of the Trail Runner shoe showing the lug pattern"
width="1200"
height="800"
loading="lazy">
With this markup:
- The image URL is in the HTML, in src, where any crawler can read it.
- The browser defers the request until the image is near the viewport.
- No script is required.
- The width and height attributes reserve space, so the layout does not jump when the image arrives.
Browser caveats. Support for the loading attribute is broad in current browsers, and a browser that does not recognize it loads the image immediately, which is a safe fallback. The distance from the viewport at which loading begins is decided by the browser and varies. Lazy loading may not apply when scripting is disabled.
Visible images and source URLs
Two rules cover the images that matter.
Do not lazy-load what is visible on arrival. Google’s guidance says “Don’t add lazy-loading to content that is likely to be immediately visible when a user opens a page”. The main image at the top of a page should load normally:
<img
src="/images/trail-runner-hero.jpg"
alt="Trail Runner shoe on a rocky path"
width="1600"
height="900"
loading="eager"
fetchpriority="high">
Keep the real URL in a standard attribute. Script-based lazy loaders have a pattern that hides the image from anything that does not run the script:
<!-- Fragile: no src, the URL is in a data attribute -->
<img data-src="/images/trail-runner-side.jpg" class="lazy" alt="Side view">
Until the script copies data-src into src, this element has no image. If the script fails, or waits for an event that never happens, the image is never referenced in the rendered page. Where a script-based loader is unavoidable, pair it with a fallback:
<img data-src="/images/trail-runner-side.jpg" class="lazy" alt="Side view of the Trail Runner shoe">
<noscript>
<img src="/images/trail-runner-side.jpg" alt="Side view of the Trail Runner shoe">
</noscript>
For images served in several sizes, the same applies to srcset: keep the candidates in the real attribute.
Images set as CSS backgrounds are a separate limit. Google’s image guidance notes that it does not index CSS images (Google’s image SEO best practices), so a picture that matters should be an img element.
Preventing user-scroll prerequisites
The failure to avoid is loading that waits for an event.
| Trigger | Works for Google? | Why |
|---|---|---|
| Native loading attribute | Yes | The URL is in the HTML |
| IntersectionObserver, loading when the element intersects the viewport | Yes | Depends on visibility, not on an action |
| A scroll event listener | Unreliable | No scrolling occurs |
| A click on a gallery thumbnail or a "show images" button | No | No click occurs |
| Hover | No | No pointer |
| Loading after a timer or after another image finishes | Unreliable | Depends on timing |
Google’s guidance names the IntersectionObserver API and viewport-based libraries as suitable, noting that these methods “don’t rely on user actions, such as scrolling or clicking”.
Galleries and carousels deserve a check. If only the first slide’s image is in the HTML and the rest are fetched when a visitor advances, those images are tied to a click. Put every slide’s image element in the HTML, with native lazy loading on the ones not shown first.
Infinite scroll has the same structure. Items that appear only as a visitor scrolls should also be reachable through paginated URLs with ordinary links.
Testing image discovery
Check with Google’s own renderer.
- In Search Console, inspect the URL and run a live test.
- Open the rendered HTML and search for the image file name. It should appear in a src or srcset attribute.
- Look at the screenshot to see whether images in the first screen are shown.
- Review the page resources list for image requests that failed or were blocked.
| Check | Pass condition |
|---|---|
| Served HTML | Each important image is an img element with a real src |
| Rendered HTML in URL Inspection | The image URL is present in src or srcset |
| Images at the top of the page | Not lazy-loaded |
| Scripts disabled | Images still appear, natively or through a noscript fallback |
| robots.txt | Image files and the image host are not blocked |
| Alt text | Describes the image |
| Galleries | Every image is in the HTML |
| Image file request | Returns 200 from the URL in the markup |
An image sitemap can list image URLs as a further route to discovery. It supplements correct markup and does not repair markup that hides the URL.
After changes, confirm over time in Search Console’s performance report, filtered to image search, that the page’s images receive impressions.
This guide concerns whether images can be found. How their dimensions and file sizes affect loading speed on phones is a separate subject, treated in the guide to how responsive image dimensions affect mobile page loading performance.
The rule: the URL in src, the trigger by visibility, and nothing important waiting for a hand on the page.
Add your comment to this answer