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 remains present in the rendered code even when a JavaScript event captures the click (e.g., mobile dropdown menu), Google processes it normally. The only problematic case is if the HTML link is entirely removed from the DOM by JavaScript during rendering; in that case, Google will no longer see it.
1:46
🎥 Source video

Extracted from a Google Search Central video

⏱ 55:02 💬 EN 📅 21/08/2020 ✂ 50 statements
Watch on YouTube (1:46) →
Other statements from this video 49
  1. 1:38 Does Google really track HTML links that are hidden by JavaScript?
  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 crawls and processes HTML links even if a JavaScript event intercepts the click—as long as the <a> tag remains in the rendered DOM. The problem only arises when JavaScript completely removes the link from the HTML code after rendering. For mobile dropdown menus with JavaScript listeners, no worries: if the href attribute exists in the final code, Google will utilize it.

What you need to understand

What does Google really see when JavaScript manages navigation?

This question comes up repeatedly since JavaScript became prevalent in modern web architectures. Google analyzes the HTML code as it exists after JavaScript execution, which is known as the final rendering or rendered DOM. If an <a href="..."> link is present in this DOM, Googlebot treats it like any standard HTML link.

It doesn't matter if a JavaScript event handler (onclick, addEventListener) captures the click to trigger an animation, open a dropdown, or load content via Ajax. As long as the <a> tag with its href attribute remains in the code, Google extracts the URL and follows the link. The fact that the user never actually clicks on this link—because a JavaScript function intervenes first—doesn't affect the crawl.

When does a link become invisible to Google?

The only problematic scenario occurs when JavaScript completely removes the link from the rendered DOM. Specifically: a script removes the <a> tag, or replaces the HTML link with a <div> that is entirely managed by JavaScript. In this case, Google sees no trace of the link in the final HTML.

This typically happens with poorly configured frameworks where navigation occurs solely through DOM manipulation via JavaScript components. If no href exists at rendering time, the link does not exist for Googlebot. The target page remains orphaned, invisible to the crawl.

How does this clarification change the game for mobile menus?

Many developers use JavaScript-driven dropdown menus to enhance mobile UX: a toggle button shows/hides links via CSS or DOM, and a JavaScript listener manages the opening. The concern? That Google ignores these links because they are "hidden" or controlled by external code.

Mueller clarifies: If the HTML link remains in the rendered DOM, Google sees and follows it. Whether the menu is closed by default, whether links are hidden via CSS (display:none, visibility:hidden), or whether a JavaScript event captures the click makes no impact. Google analyzes the final HTML, not user behavior. Therefore, a well-coded mobile menu does not penalize internal linking.

  • An HTML link present in the rendered DOM is crawled, even if JavaScript intercepts the user's click.
  • Only the complete removal of the link from the DOM (via JavaScript) prevents Google from detecting it.
  • Mobile dropdown menus with HTML links + JavaScript listeners pose no crawl issues as long as the <a href> tags remain.
  • Google relies on the final rendered DOM, not on the raw source code sent from the server before JS execution.
  • CSS hiding techniques (display:none, opacity:0) do not prevent Google from following a valid HTML link.

SEO Expert opinion

Is this statement consistent with what we observe in the field?

Yes, and it’s one of the few times when the official discourse aligns perfectly with empirical tests. Since Google improved its JavaScript rendering engine (upgrading to Chromium 109+ in 2023), HTML links present after JS execution are consistently crawled. Log audits confirm that Googlebot follows these links, even when a JavaScript event handles the click on the client side.

What changes with this clarification is that it definitively validates a common practice: using JavaScript to enhance UX without breaking the linking structure. For years, some SEOs discouraged any JavaScript listeners on navigation links, fearing a crawl impact. Let’s be honest: this fear was unfounded as long as the HTML remained clean.

What nuances should be added to this rule?

Mueller talks about the rendered DOM, meaning what Google sees after executing JavaScript. The catch? If your site relies on heavy JavaScript that takes several seconds to execute, or if the JS never loads (network error, timeout), Google may crawl an incomplete version of the DOM. In this case, a link that should appear after JS execution may remain invisible.

Another point: Mueller says "Google treats the link normally," but that doesn’t mean all links carry the same weight. A link that exists only in a mobile dropdown menu closed by default remains crawlable but potentially less valued than a link that is permanently visible in the main content. [To be verified]: no official data precisely quantifies the PageRank difference transmitted, but field observations suggest a disparity.

In what scenarios does this rule not apply?

If your site uses a full JavaScript architecture without server-side rendering (SSR) or pre-rendering, there’s a risk that Google may never see certain links. A pure client-side React/Vue/Angular site that generates the entire DOM via JS may pose issues if execution fails or if the crawl budget is exceeded before full rendering.

Another edge case: links dynamically generated after a mandatory user interaction (infinite scroll, “load more” button). If the link only exists in the DOM after a click or scroll, and that trigger is not automatic, Google may miss these links. The crawl is based on the initial rendering, not all possible DOM variations due to interactions.

Caution: Even if Google crawls an HTML link hidden by JavaScript, it does not guarantee that it indexes or values it as much as a standard link. Presence in the DOM is a necessary condition, but not sufficient.

Practical impact and recommendations

What should you check on your site?

First step: inspect the rendered DOM of your key pages using the URL inspection tool in Google Search Console, or directly in Chrome DevTools after disabling the cache. Check that all navigation links (main menu, footer, breadcrumb, pagination) appear in the final HTML with a valid href attribute.

Next, compare the initial source code (CTRL+U in Chrome) with the rendered DOM (DevTools > Elements). If critical links only exist in the rendered DOM (therefore added by JavaScript), ensure that Google has the time and resources to execute your JS. A rendering time exceeding 5 seconds or a high JavaScript failure rate in Search Console signals a problem.

What mistakes should you absolutely avoid?

Never replace an <a href> tag with a <div> or <span> clickable element driven solely by JavaScript. Even if it works for the user, Google loses track of the link. The same goes for links generated by frameworks that create "pseudo-routes" without ever injecting a real href into the DOM.

Another classic trap: using href="#" or href="javascript:void(0)" while counting on JavaScript to manage all navigation. Google follows these links, but they lead nowhere. The result? A broken internal linking structure, orphaned pages, wasted crawl budget on empty anchors.

How can you ensure your mobile menu remains crawlable?

Test your mobile dropdown menus in "CSS disabled" mode: if the links remain accessible in the raw HTML, you’re good. A good mobile menu with a JavaScript listener should maintain a semantic HTML structure: <nav>, <ul>, <li>, <a href>. JavaScript should merely add/remove a CSS class to show/hide, without manipulating the DOM to remove links.

Finally, monitor the index coverage reports in Search Console. If important pages show up as "Detected but not indexed" or "Crawled but not indexed," check that the internal links pointing to them are indeed present in the rendered DOM. A log audit can also reveal if Googlebot accesses the URLs via these links or if it ignores them.

  • Inspect the rendered DOM of all key pages via Search Console or DevTools
  • Ensure that each navigation link has a valid href attribute in the final HTML
  • Compare raw source code and rendered DOM to detect links injected by JS
  • Make sure the JavaScript rendering time stays under 5 seconds
  • Avoid href="#" or href="javascript:void(0)" on navigation links
  • Maintain a semantic HTML structure even when managing click events via JavaScript
In short: as long as your links exist in the rendered DOM with a valid href, Google follows them. JavaScript can manage clicks without breaking the crawl. But beware of JavaScript execution time and DOM manipulations that remove links. These optimizations may seem simple in theory, but their technical implementation on complex architectures (modern frameworks, SPAs, e-commerce sites) often requires in-depth diagnosis and fine-tuning. If you encounter crawl or indexing issues related to JavaScript, consulting a specialized SEO agency can accelerate resolution and avoid costly mistakes.

❓ Frequently Asked Questions

Un lien masqué en CSS (display:none) est-il crawlé par Google ?
Oui, si le lien HTML reste présent dans le DOM rendu. Google analyse le HTML final, pas les styles CSS. Un lien caché visuellement mais présent dans le code est suivi normalement.
Si JavaScript remplace un lien <a> par un <div> cliquable, Google le suit-il ?
Non. Si la balise <a href> disparaît du DOM rendu, Google ne voit plus le lien. Seul le HTML final compte : pas de <a href>, pas de crawl.
Les menus déroulants mobiles avec écouteur JavaScript posent-ils problème pour le SEO ?
Non, tant que les liens HTML restent dans le DOM rendu. Google crawle le <a href> même si JavaScript gère l'ouverture du menu ou capture le clic utilisateur.
Comment vérifier que Google voit bien mes liens après exécution JavaScript ?
Utilisez l'outil de test d'URL dans Google Search Console ou inspectez le DOM rendu dans Chrome DevTools. Comparez avec le code source brut pour identifier les liens ajoutés/supprimés par JS.
Un lien avec href="#" ou href="javascript:void(0)" est-il suivi par Google ?
Google peut techniquement suivre ces liens, mais ils ne mènent nulle part. Résultat : crawl budget gaspillé, pages cibles jamais découvertes. Toujours utiliser un href valide vers une URL réelle.
🏷 Related Topics
AI & SEO JavaScript & Technical SEO Links & Backlinks Mobile SEO Pagination & Structure

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