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

When JavaScript uses the History API to modify the URL after loading (e.g., simplifying parameters), Google may interpret this as a redirect to the new URL and choose it as canonical. This can be verified through the URL Inspection tool on both versions of the URL.
49:53
🎥 Source video

Extracted from a Google Search Central video

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

Google states that URL changes made by JavaScript through the History API can be interpreted as redirects, with the new URL potentially becoming the canonical version. For an SEO, this means that a simple client-side manipulation can impact indexing without a traditional server redirect. It remains essential to systematically verify through the URL Inspection tool whether Google is correctly understanding your initial intention.

What you need to understand

What is the History API and why do developers use it?

The History API allows JavaScript to change the URL displayed in the browser without triggering a page reload. Developers typically use it to clean up URL parameters after an action (removing ?utm_source or ?session_id), improve UX on single-page applications (SPAs), or manage complex navigation states.

For instance, a user arrives at https://example.com/page?ref=newsletter&utm_campaign=promo, and JavaScript uses history.replaceState() to change the URL to https://example.com/page once the page has loaded. From the user's perspective, it is seamless. But what about Googlebot? That's where it gets interesting.

How does Google interpret these client-side URL changes?

According to Mueller, Google may treat this manipulation as an implicit redirect to the new URL. In other words, if Googlebot visits the original URL with parameters and detects the change via JavaScript, it may decide that the parameter-free version is the canonical version to index.

The mechanism resembles a 301 or 302 redirect, but without the classic HTTP code — it is a client-side interpretation. Google crawls URL A, executes the JS, sees that the URL becomes B, and may potentially choose B as the reference URL. This logic has been part of Google's JavaScript rendering management for several years.

Mueller specifies that this behavior can be verified with the URL Inspection tool by testing both versions. If Google has correctly interpreted the change as a redirect, the final URL displayed in the tool will be the version modified by JavaScript.

What are the concrete risks for SEO?

The main danger is the loss of control over the canonical URL. If your intention was to keep the parameterized URL for tracking or segmentation reasons, but Google unilaterally decides that the cleaned version is the right one, you end up with unwanted canonicalization.

Another risk is the dilution of signals. If backlinks point to the original URL but Google indexes the modified version, PageRank and authority may become fragmented between the two versions. Without an explicit rel="canonical" tag, Google makes its own choice — and it doesn't always align with your strategy.

Finally, this behavior can create inconsistencies in Search Console: impressions and clicks distributed between URL A and URL B, confusing coverage reports, inspected URLs that do not match those you thought were indexed.

  • History API allows modifying the URL without reloading, often to clean parameters
  • Google may interpret this change as a client-side redirect and choose the new URL as canonical
  • Verifiable via URL Inspection by testing both versions
  • Risk of unwanted canonicalization if the initial intent was to keep the original URL
  • May create signal dilution between URL versions and inconsistencies in Search Console

SEO Expert opinion

Is this statement consistent with observed practices in the field?

Yes and no. On JavaScript-heavy sites (React, Vue, Angular), it is indeed observed that Google sometimes indexes client-modified URLs. But the interpretation as a "redirect" remains ambiguous — is Google referring to a signal equivalent to a 301, or merely a preference for the final URL? [To be verified]

Tests show that the behavior is not systematic. On some sites, Google indexes the destination URL (with parameters), while on others, the cleaned version. Nothing deterministic. The speed of JS rendering, the presence of a rel="canonical", and the delay between crawl and rendering can all play a role. Mueller does not provide any specific criteria to predict which behavior will prevail.

What nuances should be added to this statement?

First, saying Google "can" treat this as a redirect admits that this is not guaranteed. Unlike a true server redirect (301/302), there is no certainty that Googlebot will consistently respect URL changes made by JavaScript.

Additionally, Mueller does not specify whether this behavior applies only to replaceState() or also to pushState(). These two methods have different implications: replaceState() replaces the current URL in history, while pushState() adds a new one. If Google treats pushState() as a redirect, it could cause issues on SPAs with complex navigation.

Another point: Mueller mentions "cleaning parameters," but what about structural URL changes? If JavaScript transforms /product?id=123 into /product/product-name-123, will Google really consider that as a legitimate redirect, or as an attempt at cloaking? [To be verified]

In what cases is this rule likely not applicable?

If the URL change occurs after user interaction (click, scroll), it is unlikely that Googlebot will detect it. The bot generally crawls the initial state of the page, without simulating clicks or complex events. So a history.replaceState() triggered on scroll will probably never be seen by Google.

Similarly, if the site uses obfuscated or poorly structured JavaScript, Googlebot may fail to execute the code and thus miss the URL change entirely. Rendering timeouts (a few seconds maximum) also limit what Google can capture. A script that takes 10 seconds to modify the URL will not be processed.

Finally, if a <link rel="canonical"> tag is already present in the initial HTML and points to a different URL than the one modified by JS, Google is likely to favor the HTML canonical over the JavaScript change. Signal hierarchy: an explicit canonical should always take precedence over heuristic interpretation.

Warning: Never rely solely on this mechanism to manage your canonicals. A traditional server redirect (301) remains infinitely more reliable and predictable than a probabilistically interpreted client-side URL change by Google.

Practical impact and recommendations

What actions should you take if you use the History API?

First, systematically audit the URL changes made by JavaScript on your site. List all occurrences of history.replaceState() and history.pushState(), identify the original URL and the target URL. For each pair, ask yourself: do I want Google to index the modified URL or the destination URL?

Next, use the URL Inspection tool from Search Console on both versions. Check which URL Google considers canonical, and if it matches your intention. If you notice a discrepancy, add an explicit <link rel="canonical"> tag in the initial HTML to guide Google.

If your goal is to clean tracking parameters while keeping the parameterized URL for indexing (a rare but possible case), do not rely solely on the History API — instead, use a server redirect or a well-placed rel="canonical" parameter. Never let Google guess your intention.

What mistakes should you absolutely avoid?

Never change the URL drastically via JavaScript without a corresponding server redirect. For example, transforming /category/product into /other-category/product solely via JS is risky: Google may not follow, or worse, consider it cloaking if the content does not match the final URL.

Avoid also accumulating conflicting signals: an HTML canonical pointing to URL A, a history.replaceState() transforming to URL B, and a sitemap referencing URL C. Google will make a choice, but it is unlikely to be the one you want. Consistency: all your signals should point in the same direction.

Finally, do not rely solely on URL Inspection to validate. This tool tests a snapshot state of rendering, not necessarily representative of what Googlebot does at scale. Cross-reference with Search Console data (indexed URLs, coverage reports) and server logs if you have access.

How to check if your implementation is SEO-safe?

Establish monitoring of indexed URLs via Search Console. Regularly export the list of indexed URLs, compare it with your sitemap and intentions. If modified URLs by JavaScript appear when you do not want them, that is an alarm signal.

Test also with third-party JavaScript rendering tools (Screaming Frog in JavaScript mode, OnCrawl, Botify) to see what final URL is detected after code execution. Compare with what Google reports in the URL Inspection. If the two diverge, there is an inconsistency issue.

Finally, document every URL change via JS in a technical decision log. Note the intention, source URL, target URL, and the associated canonicalization strategy. This will help you avoid rediscovering in 6 months why a URL is indexed differently than you thought.

  • Audit all uses of history.replaceState() and pushState() on the site
  • Check with the URL Inspection tool which version Google considers canonical
  • Add an explicit rel="canonical" tag if the intention differs from observed behavior
  • Cross-reference Search Console data, server logs, and JS crawl tools to detect inconsistencies
  • Avoid accumulating conflicting signals (HTML canonical vs JS change vs sitemap)
  • Regularly monitor the list of indexed URLs to spot discrepancies
These optimizations require a fine mastery of JavaScript rendering and continuous monitoring of signals sent to Google. If your technical team lacks bandwidth or SEO expertise on these aspects, it may be wise to seek a specialized SEO agency for a thorough audit and personalized support. An external perspective often helps identify blind spots and secure your indexing strategy.

❓ Frequently Asked Questions

Google traite-t-il tous les changements d'URL via History API comme des redirections ?
Non, ce n'est pas systématique. Mueller dit que Google "peut" les traiter ainsi, ce qui signifie que le comportement dépend de plusieurs facteurs (vitesse de rendu, présence de canonical, cohérence des signaux). Rien de garanti.
Quelle différence entre replaceState() et pushState() pour Google ?
Mueller ne précise pas. replaceState() remplace l'URL actuelle dans l'historique, pushState() en ajoute une nouvelle. On ne sait pas si Google les traite de manière identique ou différente en termes de canonicalisation.
Faut-il éviter l'API History pour des raisons SEO ?
Pas nécessairement, mais il faut l'utiliser avec précaution. Si vous voulez un contrôle total sur l'URL indexée, privilégiez une redirection serveur classique (301) ou une balise canonical explicite. L'API History seule est trop imprévisible.
Comment vérifier quelle URL Google a choisi comme canonical après un changement JS ?
Utilisez l'outil Inspection d'URL de la Search Console sur les deux versions (URL d'origine et URL modifiée). Google affichera quelle version il considère comme canonical. Croisez aussi avec les données de couverture et les logs.
Un changement d'URL client-side peut-il être considéré comme du cloaking ?
Potentiellement oui, si l'URL finale ne correspond pas au contenu affiché ou si le changement semble destiné à tromper les moteurs. Google évalue la cohérence entre URL, contenu et intention. Un écart trop marqué peut lever un red flag.
🏷 Related Topics
Crawl & Indexing AI & SEO JavaScript & Technical SEO Domain Name Redirects Search Console

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