What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 3 questions

Less than 30 seconds. Find out how much you really know about Google search.

🕒 ~30s 🎯 3 questions 📚 SEO Google

Official statement

Image URLs must be in the 'src' attribute for Google to track them. If the URL is in a 'data-src' attribute, Google will not track it. The 'data-src' attribute only provides additional information, but Google fetches the image from the 'src' attribute.
38:59
🎥 Source video

Extracted from a Google Search Central video

⏱ 1704h03 💬 EN 📅 25/02/2021 ✂ 15 statements
Watch on YouTube (38:59) →
Other statements from this video 14
  1. 37:58 Le mobile-first indexing est-il vraiment la seule priorité pour votre SEO ?
  2. 42:16 Le Mobile-Friendly Test affiche-t-il vraiment ce que Google voit de votre page ?
  3. 43:03 Pourquoi vos images invisibles pour Google vous font perdre du trafic qualifié ?
  4. 47:27 Google rend-il vraiment toutes les pages JavaScript sans limitation ?
  5. 48:24 Faut-il encore optimiser JavaScript pour les moteurs de recherche autres que Google ?
  6. 49:06 Faut-il vraiment privilégier le HTML au JavaScript pour le contenu principal ?
  7. 50:43 Lazy loading : faut-il vraiment abandonner les bibliothèques JS pour les solutions natives ?
  8. 78:06 Action manuelle ou baisse algorithmique : comment identifier ce qui touche vraiment votre site ?
  9. 78:49 Le PageRank fonctionne-t-il toujours comme en 1998 ?
  10. 80:02 Comment échapper au filtre du contenu dupliqué de Google ?
  11. 80:07 Le dynamic rendering est-il vraiment mort pour le SEO ?
  12. 84:54 Pourquoi JavaScript reste-t-il la ressource la plus coûteuse pour le chargement de vos pages ?
  13. 85:17 Faut-il vraiment limiter la longueur des title tags à 60 caractères ?
  14. 86:54 Le JavaScript massacre-t-il vraiment vos Core Web Vitals ?
📅
Official statement from (5 years ago)
TL;DR

Google only crawls and indexes images whose URLs are in the src attribute, not in data-src. If you use lazy loading with data-src without a polyfill or JavaScript that switches the URL to src, your images remain invisible to the engine. In concrete terms: immediate technical audit of your images, checking the final rendering on Google's side, and correcting failing implementations.

What you need to understand

What is the technical difference between src and data-src for Google?

The src attribute is the HTML standard that tells the browser — and Googlebot — where to load an image resource. It's what the crawler reads directly in the DOM. The data-src attribute, on the other hand, is a custom attribute (data-* attribute) commonly used in lazy loading solutions: the image is not loaded immediately, but only when it becomes visible in the viewport.

The problem? Google does not natively read data-src. If your JavaScript never switches the URL from data-src to src, or if the JavaScript rendering fails, Googlebot sees an <img data-src="..." src=""> element with an empty or missing src. The result: no indexed image, no chance to appear in Google Images, and a substantial loss of SEO traffic.

Why do so many sites still fail on this point?

Because lazy loading libraries (LazyLoad, Lozad, etc.) and some CMS (WordPress with misconfigured plugins, Shopify with third-party themes) inject data-src by default without always ensuring a switch to src. Developers test in desktop mode with JavaScript enabled, everything works visually, but they never check the rendering on Googlebot.

However, Googlebot does indeed execute JavaScript, but with limitations: a 5-second timeout for rendering, no simulated scrolling (thus no triggering of IntersectionObserver events for certain images), and blocked resources that can prevent the JS from executing correctly. If your script doesn't pass data-src to src within this timeframe, the image is lost.

Does Google Search Console help in detecting this issue?

Yes, but not directly. The URL Inspection tool displays the final HTML rendering as seen by Google. If you inspect a page and the <img> tags don’t have a specified src, that's the signal. You can also cross-reference with the Coverage > Images report: if pages with a lot of images show 0 or very few indexed images, it's probably data-src that's stuck.

The issue is that GSC does not do automatic detection or specific alerts for 'images in data-src not indexed’. You must manually audit, URL by URL, or use a third-party crawler (Screaming Frog, OnCrawl, Botify) that simulates JavaScript rendering and compares src/data-src attributes.

  • src is the standard attribute that Google tracks to index images
  • data-src is invisible to Googlebot if no JavaScript switches it to src
  • The native lazy loading (loading="lazy") works with src, not with data-src
  • Google Search Console allows you to check the final rendering, but does not automatically detect this problem
  • A technical audit with a JS crawler is essential to map lost images

SEO Expert opinion

Is this statement consistent with practices observed in the field?

Absolutely. It has been observed for years that sites implementing lazy loading via data-src without fallback lose image indexing. Production testing confirms this: an e-commerce site with 10,000 product listings and poorly configured lazy loading can have 80% of its images missing from Google Images. This is not a theoretical nuance, it's a traffic sinkhole.

What is less discussed is that native lazy loading (loading attribute loading="lazy") resolves this issue: it works with src, Google interprets it correctly, and no JavaScript manipulation is necessary. Since 2019, it is supported by Chrome, Firefox, Edge, Safari — and most importantly, by Googlebot. If you're still using third-party scripts for lazy loading, now is the time to migrate to the HTML standard.

What nuances should be added to this Google assertion?

First nuance: Google can index an image whose URL appears elsewhere in the code (CSS background, JSON-LD script, <link rel="preload"> tag), but this is marginal and not guaranteed. The only reliable method remains src in <img>. Don't count on detours.

Second nuance: even if your JavaScript correctly switches data-src to src, if this script is blocked by robots.txt, loaded late after the rendering timeout, or depends on an external library that fails, Google will see the initial DOM with data-src. In other words, [To be verified] ensure that your JavaScript rendering chain is robust and that all critical files are crawlable.

In what cases does this rule not apply or become secondary?

If your images have no SEO value (decorative icons, CSS sprites, purely UX illustrations without search value), then data-src or even the complete absence of an <img> tag has no impact. Google will not seek to index PNGs of arrows or buttons.

Conversely, for any content that can generate traffic through Google Images — product photos, infographics, editorial visuals, portfolios, recipes, before/after images — the rule is absolute: src required, data-src forbidden without guaranteed switching. And here, it's critical.

Attention: Some JavaScript frameworks (React, Vue, Next.js with next/image) generate <img> tags with data-src in SSR then switch to src on the client side. Always check the server-side rendering and the final HTML sent to Googlebot, not just what you see in the browser.

Practical impact and recommendations

What should you concretely do to ensure Google indexes your images?

First, audit the existing setup. Crawl your site with Screaming Frog in JavaScript mode enabled (or OnCrawl, Botify, Sitebulb) and extract all <img> tags. Filter those that have a data-src specified but an empty or missing src. This is your blacklist.

Next, check the actual rendering on Google: use the URL Inspection tool in Search Console on some typical pages (product listing, blog article, gallery page). Look at the rendered HTML and search for <img> tags: if src is empty, you have a problem. Cross-reference with the Indexed Images report: if the number of indexed images is abnormally low, it's confirmed.

What errors should be avoided when complying?

Error #1: adding an empty src="" thinking it’s better than nothing. No. An empty src triggers an HTTP request to the page itself, which pollutes your logs, increases wasted crawl budget, and does not index anything. If you cannot specify src immediately, use a low-weight placeholder (inline SVG data:image, or 1x1 px image) while waiting for lazy load.

Error #2: blocking lazy loading scripts in robots.txt. If your JS is blocked, Google cannot execute it, so data-src never switches to src. Check that all critical .js files for image rendering are crawlable.

How to verify that your implementation works after correction?

Use the Mobile-Friendly Test tool or PageSpeed Insights, which run JavaScript and display the final DOM. Inspect the <img> tags in the screenshot and rendered HTML: src should be populated with the final image URL. If it's good, trigger another URL inspection in GSC and request re-indexing.

Then, monitor the Indexed Images report in GSC over 4-6 weeks. You should see a rising curve in the number of discovered and indexed images. If it stagnates, there may be uncorrected pages or your image sitemap is not submitted. Cross-reference with Google Analytics / GA4: traffic from Google Images (source/medium = google/organic, landing page = /images or image search) should increase.

  • Crawl the site in JavaScript mode to detect <img> tags with data-src but no src
  • Check Google's rendering via URL Inspection (Search Console) on typical pages
  • Migrate to native lazy loading loading="lazy" with populated src
  • Remove or correct third-party scripts that inject data-src without fallback
  • Ensure critical JavaScript files are not blocked by robots.txt
  • Submit an image sitemap with the correct URLs (referring to src, not data-src)
Let’s be honest: migrating a historical lazy loading architecture to a compliant implementation can quickly become technical — especially if you manage a large site with multiple templates, JavaScript frameworks, or custom CMSs. Between the audit, pattern detection, code correction, rendering tests, and re-indexing follow-up, this is a project that requires expertise and diligence. If you don't have the internal resources to manage it properly, enlisting a specialized technical SEO agency can accelerate compliance and secure your image traffic gains.

❓ Frequently Asked Questions

Est-ce que Google indexe les images si elles sont uniquement en CSS background-image ?
Non, Google n'indexe pas les images déclarées uniquement en CSS background-image. Il faut une balise <img> avec un attribut src pour que l'image soit découverte et indexée par Google Images.
Le lazy loading natif (loading="lazy") est-il compatible avec l'indexation Google ?
Oui, totalement. L'attribut loading="lazy" fonctionne avec src, donc Google indexe normalement l'image. C'est même la méthode recommandée pour le lazy loading depuis 2019.
Si mon JavaScript bascule data-src vers src après 3 secondes, Google verra-t-il l'image ?
Probablement oui, car Googlebot patiente environ 5 secondes pour le rendu JavaScript. Mais c'est risqué : si le script plante ou tarde, l'image est perdue. Mieux vaut passer directement src en SSR.
Faut-il soumettre un sitemap d'images si toutes les images ont un src correct ?
Ce n'est pas obligatoire, mais fortement recommandé pour accélérer la découverte et l'indexation, surtout sur des sites volumineux ou avec beaucoup d'images. Le sitemap doit référencer les URL en src.
Comment savoir combien d'images Google a indexées sur mon site ?
Dans Google Search Console, allez dans Performances puis filtrez par type de recherche « Image ». Vous verrez le nombre d'impressions et de clics. Pour un décompte précis, croisez avec un crawler tiers et comparez les images découvertes vs. indexées.
🏷 Related Topics
Domain Age & History AI & SEO Images & Videos Domain Name

🎥 From the same video 14

Other SEO insights extracted from this same Google Search Central video · duration 1704h03 · published on 25/02/2021

🎥 Watch the full video on YouTube →

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.