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

Google can follow JavaScript-injected links when they are in the <a> tag format with an href attribute. However, elements like buttons or spans with onClick event handlers are not followed.
23:12
🎥 Source video

Extracted from a Google Search Central video

⏱ 55:57 💬 EN 📅 03/04/2020 ✂ 23 statements
Watch on YouTube (23:12) →
Other statements from this video 22
  1. 1:36 Le fichier de désaveu fonctionne-t-il vraiment lien par lien au fil du crawl ?
  2. 4:39 Les menus dupliqués mobile/desktop pénalisent-ils vraiment votre SEO ?
  3. 8:21 Faut-il vraiment nofollow les liens entre vos pages de succursales ?
  4. 8:41 Faut-il vraiment placer vos produits phares dans la navigation principale ?
  5. 9:07 Le balisage de données structurées erroné pénalise-t-il vraiment votre référencement ?
  6. 10:20 Faut-il vraiment placer vos pages stratégiques dans la navigation principale pour mieux ranker ?
  7. 11:26 Google ignore-t-il vraiment les données structurées mal balisées sans pénaliser la page ?
  8. 13:01 Le contenu masqué derrière des onglets est-il vraiment indexé par Google ?
  9. 13:42 Le contenu derrière des onglets est-il vraiment indexé en mobile-first ?
  10. 14:36 Google filtre-t-il manuellement les sites médicaux pour garantir la qualité des résultats ?
  11. 16:40 Faut-il abandonner Data Highlighter au profit du JSON-LD ?
  12. 20:09 Les liens en nofollow sont-ils vraiment ignorés par Google pour le SEO ?
  13. 20:19 Google suit-il vraiment les liens nofollow pour découvrir de nouveaux sites ?
  14. 22:42 Les liens JavaScript sans href sont-ils vraiment invisibles pour Google ?
  15. 27:47 Faut-il vraiment centraliser son contenu pour ranker sur Google ?
  16. 29:55 Le contenu de qualité suffit-il vraiment à générer des liens naturels ?
  17. 30:03 L'autorité de domaine est-elle vraiment inutile pour ranker dans Google ?
  18. 30:16 Pourquoi Google considère-t-il les liens sur sites d'images, petites annonces et plateformes gratuites comme du spam ?
  19. 38:17 Comment Google déclare-t-il vraiment son user-agent lors du crawl ?
  20. 43:06 Google reconnaît-il vraiment tous les formats d'intégration vidéo pour le SEO ?
  21. 44:12 Les cookies tiers bloqués impactent-ils vraiment votre trafic mobile dans Analytics ?
  22. 51:11 Faut-il abandonner la version desktop pour optimiser uniquement la version mobile ?
📅
Official statement from (6 years ago)
TL;DR

Google only follows JavaScript links structured as <a> tags with href attributes. Buttons, spans, and other clickable elements driven by onClick or addEventListener remain invisible to Googlebot. Concretely: a pure JavaScript hamburger menu or button pagination may block exploration of entire sections of your site. The solution lies in redesigning interactive components or implementing a progressive enhancement strategy.

What you need to understand

What does Google really see in a JavaScript link?

Googlebot handles dynamically injected links, but under a strict condition: they must adhere to classical HTML semantics. A valid link for Google is an <a> tag containing a href attribute pointing to a URL.

The catch? Many modern frameworks generate pseudo-links: <div>, <span>, or <button> styled as links, with an onClick handler that triggers navigation. For the user, it works. For Googlebot, it's empty — it does not execute event handlers attached to non-<a> elements.

Why does this technical distinction have such an SEO impact?

Because a link invisible to Google means an orphan page. If your navigation menu relies on JavaScript buttons, Googlebot won't follow those paths. The result: entire sections of your site may remain out of the index.

This is especially critical for single-page applications (SPAs) and React, Vue, or Angular apps that recreate navigation from scratch. A router.push() triggered by an onClick on a <div> leaves no trace to explore. Google doesn't guess intent: it follows what it sees in the final DOM.

In what contexts does this rule pose the most problems?

JavaScript-heavy architectures are the most affected. E-commerce sites with dynamic pagination, blogs with infinite scroll, SaaS dashboards — anywhere navigation relies on complex interactivity. A classic example: a product filter modal triggered by a button. If the links to the filtered pages are generated in this modal via JavaScript, but without <a> tags, Google will never discover them.

Another common case: mobile menus. Many hamburger menus are implemented with <button> elements that reveal <div> containing links. If these links are themselves pseudo-links, that's a double whammy: the menu is not crawled AND the destinations remain invisible.

  • Google only follows <a href="URL"> tags, even if they are injected by JavaScript after the initial load.
  • <button>, <span>, and <div> elements with onClick are NOT considered links, even if they trigger client-side navigation.
  • A site may work perfectly for users but fail completely in crawlability if its links do not adhere to this semantics.
  • Modern JavaScript frameworks require explicit configuration to generate usable <a> tags (e.g., <Link> in React Router with href or <router-link> in Vue).
  • Progressive enhancement remains the safest strategy: a link must function even if JavaScript is turned off or fails.

SEO Expert opinion

Is this statement consistent with field observations?

Yes, and it has been documented for years. Tests with Search Console and rendering tools show that Googlebot systematically ignores onClick events on non-<a> elements. Let's be honest: Google has improved JavaScript rendering, but remains cautious. It takes no risks with ambiguous or non-standard patterns.

What is less clear — and Google remains evasive about it — is the processing delay. Is a valid JavaScript link followed as quickly as a static HTML link? [To be verified]. Observations suggest a slight delay, but no official data quantifies this differential. In production, it is observed that links injected after several seconds of rendering may slip through the cracks if the crawl budget is tight.

What nuances should be added to this rule?

The Splitt statement is binary, but reality is more nuanced. Google can theoretically discover URLs via other channels: XML sitemaps, external links, crawl history. An onClick button leading to /product-X won't transmit the link, but if /product-X is declared in the sitemap, Google will still crawl it.

The issue lies with internal PageRank. Even if the page is indexed, the lack of <a> links means zero transmission of SEO juice. A strategic product hidden behind a JavaScript button will receive no weight from the homepage. This is the blind spot of many SPA sites: the pages exist, but they are SEO-orphans, with no authority transmitted.

In what cases does this rule not apply?

There is a notable exception: links discovered via server-side rendering (SSR). If your framework (Next.js, Nuxt, Angular Universal) generates static HTML with <a> on the very first server response, Google sees them immediately, without waiting for JavaScript execution. The JavaScript can then upgrade these links to client-side navigation, but the fallback HTML remains usable.

Another edge case: Single Page Apps with prerendering. Tools like Prerender.io or Rendertron serve Googlebot a pre-rendered version with all the <a> links present. Technically compliant, but beware: Google may detect cloaking if the content served to the bot differs too much from what the user sees. The line is thin.

Attention: Do not rely on sitemaps to compensate for a deficient link architecture. A sitemap does not replace internal linking. Google values contextual links within content — an XML sitemap transmits no PageRank.

Practical impact and recommendations

What should be prioritized in an audit of a JavaScript site?

Start by crawling your site with a tool that simulates Googlebot: Screaming Frog in JavaScript mode, Sitebulb, or directly the URL inspection tool in Search Console. Compare the number of links discovered with JavaScript enabled versus disabled. A significant gap signals a problem.

Next, inspect the final DOM in Chrome DevTools. Click on a suspicious navigation element and check if it's a <a> or a <button> / <div>. If you see onclick="navigateTo('/page')" without a href attribute, it's a ghost link for Google. Replace it with a real <a> tag, even if you keep a JavaScript handler for client-side routing.

How to refactor a problematic navigation component?

The technical solution depends on your framework. In React Router, use the <Link to="/page"> component which generates a <a href="/page"> while handling client-side routing. In Vue, it's <router-link :to="/page">. For Angular, <a [routerLink]="'/page'">. These components ensure HTML semantics while preserving the SPA experience.

If you cannot touch the JavaScript (legacy constraints, closed CMS), an alternative is to add static HTML links in the footer or a secondary menu. Less elegant, but it ensures crawlability. Also consider a traditional HTML sitemap, with <a> tags leading to all strategic pages. Google loves this old-school format.

What mistakes should be absolutely avoided?

Don't confuse progressive enhancement with graceful degradation. Progressive enhancement means the site works WITHOUT JavaScript, adding comfort with JS. Graceful degradation assumes JS works and provides a minimal fallback if it breaks. For SEO, only progressive enhancement guarantees crawlability.

Another frequent mistake: believing that an <a> without href but with onClick is sufficient. No. Without href, it's not a valid HTML link — even if it looks like a link. Google purely and simply ignores these elements. The href is mandatory for an <a> to be considered usable.

  • Audit all navigation components (menus, paginators, filters, calls-to-action) and ensure they generate <a href="...">.
  • Test the site with JavaScript disabled or via the Search Console inspection tool to identify invisible links.
  • Favor server-side rendering (SSR) or static generation (SSG) for strategic pages.
  • Implement a complete XML sitemap, but do not rely on it exclusively — internal linking comes first.
  • Add an HTML sitemap with <a> links to all important sections of the site.
  • Train development teams on HTML semantics and the importance of <a> tags for SEO.
Refactoring a JavaScript link architecture can be complex, especially on modern tech stacks or legacy systems. The SEO implications of poor implementation are severe: loss of crawl budget, orphan pages, dilution of internal PageRank. If you identify these patterns on your site, a thorough analysis is required. Consulting an SEO agency specialized in JavaScript issues can provide a precise audit, technical recommendations tailored to your framework, and support to prioritize the tasks without breaking the existing user experience.

❓ Frequently Asked Questions

Un lien <a> sans href mais avec onClick est-il suivi par Google ?
Non. Sans attribut href, la balise <a> n'est pas considérée comme un lien valide par Googlebot, même si elle déclenche une navigation via JavaScript. Le href est obligatoire pour la crawlabilité.
Les liens générés après un clic utilisateur sont-ils explorés ?
Seulement s'ils sont injectés dans le DOM sous forme de <a href>. Googlebot ne simule pas les clics utilisateur — il lit le DOM tel qu'il est rendu après l'exécution JavaScript initiale, sans interaction.
Un site SPA sans SSR peut-il être correctement indexé ?
Techniquement oui, si tous les liens sont des <a href> valides et que Google alloue suffisamment de crawl budget. En pratique, c'est risqué : les délais de rendu et la gestion des routes côté client compliquent l'exploration. Le SSR ou le prerendering sont fortement recommandés.
Les frameworks JavaScript modernes génèrent-ils des liens SEO-friendly par défaut ?
Pas toujours. React, Vue et Angular proposent des composants de routing (Link, router-link, routerLink) qui génèrent des <a href>, mais rien n'empêche un développeur de coder des boutons onClick. La configuration et la discipline de code sont cruciales.
Le PageRank interne est-il transmis via un lien JavaScript valide ?
Oui, si c'est un <a href>. Google traite ces liens comme n'importe quel lien HTML une fois le rendu effectué. La transmission de PageRank fonctionne normalement, mais avec un risque de retard si le rendering prend du temps.
🏷 Related Topics
AI & SEO JavaScript & Technical SEO Links & Backlinks

🎥 From the same video 22

Other SEO insights extracted from this same Google Search Central video · duration 55 min · published on 03/04/2020

🎥 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.