What does Google say about SEO? /
Quick SEO Quiz

Test your SEO knowledge in 5 questions

Less than a minute. Find out how much you really know about Google search.

🕒 ~1 min 🎯 5 questions

Official statement

If an HTML link exists in the code but a JavaScript event captures the click (for example, to display a dropdown menu instead of navigating), Google can still see and follow that HTML link. The <a> element must remain present in the rendered DOM, even if the user behavior is modified by JavaScript.
1:38
🎥 Source video

Extracted from a Google Search Central video

⏱ 55:02 💬 EN 📅 21/08/2020 ✂ 50 statements
Watch on YouTube (1:38) →
Other statements from this video 49
  1. 1:46 Can JavaScript really hide your links from Google without destroying them?
  2. 3:43 Is it really necessary to optimize the first link on a page for SEO?
  3. 3:43 Does Google really combine signals from multiple links pointing to the same page?
  4. 5:20 Do site-wide links in the menu and footer really dilute the PageRank of your strategic pages?
  5. 6:22 Is it really necessary to nofollow site-wide links to your legal pages to optimize PageRank?
  6. 7:24 Should you really keep nofollow on your footer links and service pages?
  7. 10:10 Why does Google make it impossible to use Search Console Insights without Analytics?
  8. 11:08 Does Nofollow still affect crawling without passing on PageRank?
  9. 11:08 Does nofollow really block indexing, or can Google still crawl those URLs?
  10. 13:50 Why is Google so tight-lipped about its indexing incidents?
  11. 15:58 Should you really index all paged pages to optimize your SEO?
  12. 15:59 Is it really necessary to index all pagination pages to optimize your SEO?
  13. 19:53 Are URL parameters still an obstacle for organic search?
  14. 19:53 Are URL parameters really a non-issue for SEO anymore?
  15. 21:50 Is it true that Google is blocking the indexing of new sites?
  16. 23:56 Do links in embedded tweets really affect your SEO?
  17. 25:33 Are sitemaps really essential for Google indexing?
  18. 26:03 How does Google really discover your new URLs?
  19. 27:28 Why does Google require a canonical on ALL AMP pages, including standalone ones?
  20. 27:40 Is the rel=canonical really mandatory on all AMP pages, even standalone ones?
  21. 28:09 Should you really implement hreflang across an entire multilingual site?
  22. 28:41 Should you really implement hreflang on every page of a multilingual website?
  23. 29:08 Is it true that AMP is a speed factor for Google?
  24. 29:16 Should you still invest in AMP to optimize speed and ranking?
  25. 29:50 Why does Google measure Core Web Vitals on the actual page version your visitors are really viewing?
  26. 30:20 Do Core Web Vitals really measure what your users actually see?
  27. 31:23 Should you manually deindex old pagination URLs after changing your site's architecture?
  28. 31:23 Is it really necessary to manually de-index your old pagination URLs?
  29. 32:08 Is advertising on your site harming your SEO?
  30. 32:48 Does having ads on your site really hurt your Google rankings?
  31. 34:47 Is rel=canonical in syndication really reliable for controlling indexing?
  32. 34:47 Does rel=canonical really protect your syndicated content from ranking theft?
  33. 38:14 Do security alerts in Search Console really block Google's crawling?
  34. 38:14 Can a hacked site lose its crawl budget due to Google security alerts?
  35. 39:20 Have links in guest posts really lost all SEO value?
  36. 39:20 Do guest post links really have no SEO value?
  37. 40:55 Why does Google ignore identical modification dates in your sitemaps?
  38. 40:55 Why does Google ignore the lastmod dates in your XML sitemap?
  39. 42:00 Should you really update the lastmod date of the sitemap for every minor change?
  40. 42:21 Does a poorly configured sitemap really diminish your crawl budget?
  41. 43:00 Can a misconfigured sitemap really cut down your crawl budget?
  42. 44:34 Should you really have to choose between reducing duplicate content and using canonical tags?
  43. 44:34 Is it really necessary to eliminate all duplicate content or should you rely on rel=canonical?
  44. 45:10 Should you really set a crawl limit in Search Console?
  45. 45:40 Should you really let Google decide your crawl limit?
  46. 47:08 Do internal 301 redirects really dilute PageRank?
  47. 47:48 Do cascading internal 301 redirects really drain SEO juice?
  48. 49:53 Can the JavaScript History API really force Google to change your canonical URL?
  49. 49:53 Can Google really treat URL changes made by JavaScript and the History API as redirects?
📅
Official statement from (5 years ago)
TL;DR

Google claims it can see and follow HTML links present in the DOM, even if a JavaScript event intercepts the click to alter user behavior. The <a> element must remain accessible in the rendered code to be considered. This technical nuance is a game changer for dropdown menus, overlays, and interactive interfaces relying on event listeners.

What you need to understand

Why is this statement important for crawling?

Google distinguishes between the existence of an HTML link and its click behavior. An element can indeed point to a URL while having a JavaScript event listener that prevents navigation (via preventDefault(), for example).

In this case, the user does not navigate — they trigger a menu, a modal, an overlay. But Googlebot sees the underlying HTML link and can follow it. This is a fundamental distinction: what matters for crawling is the presence of the element in the rendered DOM, not the client-side behavior.

What’s the difference with a purely JavaScript link?

A purely JavaScript link has no usable href attribute. It could be a

, a , or even an without a valid href. These elements require Google to execute the JavaScript to discover the destination.

With an onClick={handleClick}, the link already exists in the HTML. Google doesn't even need to execute the JS to see it — it appears from the initial rendering of the DOM. This is infinitely more reliable for crawling.

What happens if the link is removed from the DOM by JavaScript?

If your JavaScript removes the element from the DOM after the first render, Google likely won’t see it during indexing. The timing of the rendering matters: Googlebot takes a snapshot of the DOM after JS execution, but this snapshot occurs at a given moment.

If the link is only injected after a user interaction (hover, scroll, click), it may never be crawled. The rule is simple: the link must be present in the rendered DOM at the time Googlebot takes its snapshot, without requiring any user interaction.

  • An HTML link with a JS event listener remains crawlable as long as the element is present in the rendered DOM.
  • User behavior (navigating or not) does not affect crawling — Google follows the href regardless of the JavaScript.
  • Links injected after interaction (hover, click) or dynamically removed from the DOM are not guaranteed to be seen.
  • Prefer a real link with preventDefault() rather than an onclick without a usable href.
  • Check the rendered DOM via the URL inspection tool in Search Console to ensure that the links appear correctly.

SEO Expert opinion

Is this statement consistent with real-world observations?

Yes, this is one of the rare instances where Google is perfectly consistent with what we observe in practice. Tests show that Googlebot indeed follows links even when a JavaScript event listener modifies the behavior. Well-coded dropdown menus, with real HTML anchors, are crawled without issue.

On the other hand, as soon as we move to a pure JavaScript approach without href, it's a gamble. Google can execute the JS and discover the destination, but this is neither guaranteed nor fast. The performance difference is measurable: an HTML link is discovered instantly, whereas a JS link may take days or even weeks to be followed.

What nuances should be added to this rule?

The timing of the rendering is crucial. Googlebot will not hover over your elements, nor will it click your buttons to reveal hidden links. If your dropdown menu only displays links on hover, and these links are not present in the initial DOM, Google will not see them.

Similarly, a link loaded via an AJAX request after infinite scrolling or a click on

Practical impact and recommendations

Que faut-il faire concrètement pour sécuriser le crawl de vos liens ?

La priorité absolue : toujours utiliser un élément avec un href valide, même si vous interceptez le clic via JavaScript. Ne vous reposez jamais uniquement sur un onclick ou un event listener sans ancre HTML sous-jacente. C'est la garantie que Google verra et suivra le lien.

Pour les menus dropdown, assurez-vous que les liens enfants sont présents dans le DOM initial, pas injectés au hover. Si vous devez les masquer, utilisez des techniques CSS (max-height, opacity) plutôt que de les retirer complètement du DOM. Googlebot ne simule pas le hover, mais il parse le HTML rendu.

Quelles erreurs éviter absolument ?

Ne créez pas de liens factices avec ou . Ces patterns sont un cauchemar pour le crawl : Google voit un lien, tente de le suivre, et tombe sur rien. Même si votre JS gère la navigation, Googlebot ne l'exécutera peut-être pas — il faut un href réel.

Évitez également de retirer dynamiquement les liens du DOM après le premier rendu. Si votre framework React ou Vue unmount des composants contenant des liens suite à une interaction, ces liens risquent de disparaître avant que Googlebot ne prenne son snapshot. Préférez les masquer en CSS plutôt que de les supprimer.

Comment vérifier que vos liens sont bien crawlables ?

Utilisez l'outil d'inspection d'URL dans Google Search Console et cliquez sur "Afficher la page explorée". Regardez le HTML rendu : vos liens apparaissent-ils ? Si oui, Google les voit. Si non, il y a un problème de rendu ou de timing.

Complétez avec un audit Screaming Frog en mode JavaScript activé. Comparez les liens découverts en mode HTML seul vs. en mode rendu JS. Si des liens n'apparaissent qu'après exécution JS et qu'ils n'ont pas de href exploitable, c'est un red flag. Vous dépendez alors de l'exécution JS de Google, ce qui est risqué.

  • Vérifier que tous les liens importants utilisent un valide, même si un event listener modifie le comportement.
  • S'assurer que les liens sont présents dans le DOM rendu sans interaction utilisateur (pas de hover, clic ou scroll requis).
  • Tester le rendu avec l'outil d'inspection d'URL dans Search Console pour valider que Google voit bien les liens.
  • Éviter les href="#" ou href="javascript:void(0)" — toujours pointer vers une URL réelle.
  • Préférer le masquage CSS au retrait du DOM pour les éléments interactifs (menus, overlays).
  • Auditer régulièrement le maillage interne en mode JS activé pour détecter les liens invisibles ou mal formés.

❓ Frequently Asked Questions

Google suit-il un lien <a> si un event.preventDefault() empêche la navigation ?
Oui. Google voit l'attribut href et peut suivre le lien indépendamment du comportement JavaScript côté client. Le preventDefault() n'affecte que l'expérience utilisateur, pas le crawl.
Les liens dans un menu dropdown sont-ils crawlés même s'ils ne s'affichent qu'au hover ?
Seulement s'ils sont présents dans le DOM rendu sans interaction requise. Googlebot ne simule pas le hover — si le lien n'existe que dans le DOM après un :hover CSS ou un événement JS, il ne sera pas crawlé.
Un lien <a href="#"> avec navigation gérée en JavaScript est-il crawlable ?
Non. Google voit un lien pointant vers un fragment vide. Même si votre JS gère la navigation, Googlebot ne l'exécutera peut-être pas. Utilisez toujours un href valide pointant vers l'URL réelle.
Faut-il éviter les liens display:none pour ne pas être pénalisé ?
Google tolère les liens masqués s'ils ont une justification UX (menu mobile, accordéon). Mais des liens invisibles sans raison légitime peuvent être interprétés comme manipulatoires. Privilégiez la transparence.
Les SPAs avec routage client-side doivent-elles utiliser des href complets ?
Absolument. Même si React Router ou Vue Router interceptent le clic, le href doit pointer vers l'URL finale (ex: /page, pas #page). Sinon, Google ne voit qu'un lien vide et ne crawle rien.
🏷 Related Topics
AI & SEO JavaScript & Technical SEO Links & Backlinks Pagination & Structure Local Search

🎥 From the same video 49

Other SEO insights extracted from this same Google Search Central video · duration 55 min · published on 21/08/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.