Discussion starter: a technical SEO question, posted with an answer from Niraj Raut to open the thread. If you have dealt with this on a site, reply with what you saw, especially where it differs.
- Technical SEO
Lazy-loading scripts that swap src for data-src with no fallback: have you confirmed Google Images losses from them, or is the risk overstated?
Disclosure: Niraj Raut, who posted this answer, runs the SEO consultancy linked at the end of it.
1 reply
-
adminAdmin
The risk is real for a specific implementation and overstated for others. Lazy-loading scripts that keep the real image address in
data-srcand only copy it intosrcwhen the user scrolls can leave Google’s rendered page without real image URLs, because Google’s renderer does not scroll like a user. If those images have no fallback, Google may not find or index them, and image search, Lens and visual search visibility suffers. Implementations that use the browser’s nativeloading="lazy"attribute, or that load images when they enter the viewport using the IntersectionObserver approach Google’s documentation describes, generally work. You can confirm which case you are in within a few minutes using URL Inspection.How to check your implementation
- Run URL Inspection’s live test on a page with lazy-loaded images and view the rendered HTML. Look at the image elements: do they have a real image URL in
src, or a placeholder, with the real URL only indata-src? - Look at the screenshot in the test result. Placeholder boxes where images should be are a warning sign, although the screenshot only shows the top of the page.
- Check images further down the page, which are the ones most likely to depend on scroll events.
- Compare with Search Console data. Use the Image search type and the multimodal filter to see whether pages with lazy-loaded images receive image impressions. Pages with many product images but almost no image impressions are candidates.
Which implementations are safe
Implementation Risk Native loading="lazy"on img elements with realsrcLow IntersectionObserver-based loading that sets srcwhen images enter the viewportGenerally low; confirm in URL Inspection Scroll or resize event handlers that set srcfromdata-srcHigh Any method with a noscript fallback containing the real image Reduced, but the fallback must be present and correct Images loaded only after user interaction such as clicks or carousel swipes High for the images not shown initially Fixing it
- Switch to native lazy loading where possible: real
src,loading="lazy", and width and height attributes to avoid layout shift. - Do not lazy-load images at the top of the page, especially the main product or hero image; it delays Largest Contentful Paint.
- If you keep a script-based approach, make sure it uses viewport detection rather than scroll events, and add a noscript fallback.
- For image carousels, make sure every important image is referenced with a real URL in the HTML, even if hidden visually until selected.
- Consider an image sitemap for important images; Google’s documentation says image sitemaps can help it discover images it might not otherwise find.
Hypothetical example:
A fashion retailer uses an old lazy-loading library that sets image sources on scroll. URL Inspection shows the first product image loaded and the other five with a grey placeholder in
src. Search Console shows very low image impressions for product pages compared with competitors’ visibility in Lens. The team moves to native lazy loading for secondary images and eager loading for the main image. Over the following two months, image and multimodal impressions rise substantially, and Largest Contentful Paint on product pages improves because the main image is no longer deferred.Watch for this:
Changing lazy-loading also changes image URLs on some platforms, for example if the library used different file sizes. If URLs change, image visibility can dip while Google discovers the new ones. Keep the image URLs referenced in
srcstable wherever possible.Background images and CSS are a separate case
Images set as CSS backgrounds, rather than img elements, are generally not indexed as images in the way inline images are. Hero banners and product imagery implemented as background images can therefore be invisible to image search even when they load perfectly for users. If an image carries information you want found, such as a product photo or a diagram, use an img element with a real
srcand descriptive alt text. Reserve CSS backgrounds for decorative imagery. The same applies to images drawn onto a canvas element or embedded in scripts: users see them, but search engines have little to index.Is the risk overstated?
For sites using native lazy loading or modern libraries, often yes: many “lazy loading kills image SEO” warnings date from older implementations. For sites still running scroll-based scripts without fallbacks, no: the loss is real and easy to confirm. The only way to know which applies to you is to look at the rendered HTML.
Inspect the rendered HTML, move to native lazy loading with real image URLs, never lazy-load the main image, keep fallbacks where scripts remain, and confirm the fix through image and multimodal impressions in Search Console.
Need help with this on your own site?
Niraj Raut works with businesses in Nepal, Australia, the UK, Europe and the US on technical SEO, ecommerce SEO, local SEO and AI search.
- Run URL Inspection’s live test on a page with lazy-loaded images and view the rendered HTML. Look at the image elements: do they have a real image URL in
Add a reply Cancel reply
Replies are open to approved members. Log in or apply to join.