Images · Image loading

Lazy-loaded image with no real src

An image on this page keeps its address in a data-src attribute and has no real src, so it only appears once a script copies it across.

How this page is built

The image below has no src attribute. Its address is in data-src, and a small script copies it into src when the page has loaded, as older lazy loading libraries do.

A grey test card

Why it matters

Older lazy loading scripts store the real image address in a data attribute and only add it to src when the image is needed. Search engines that do not run the script, and tools that read the raw HTML, see an image with no source.

Even Google, which does run scripts, may not trigger the loading if it depends on scrolling. The image may then never be indexed.

How to check it

View the source and look for img elements with data-src or similar attributes and no src. Compare the raw HTML with the rendered HTML in a crawl tool or in the URL inspection tool in Google Search Console.

How to fix it

Use native lazy loading instead: put the real address in src and add loading=“lazy”. Browsers then load the image when it is needed, and search engines can always see it.

Back to all tests