What does Google say about SEO? /

Official statement

When there are inconsistencies between the initial HTML and the rendered HTML (canonical, noindex, title), it is considered undefined behavior. Google may unpredictably choose either one. This situation should be absolutely avoided.
13:12
🎥 Source video

Extracted from a Google Search Central video

⏱ 30:57 💬 EN 📅 11/11/2020 ✂ 26 statements
Watch on YouTube (13:12) →
Other statements from this video 25
  1. 1:36 How can you effectively test JavaScript rendering before taking your site live?
  2. 1:36 Why has testing JavaScript rendering before launch become essential for Google indexing?
  3. 1:38 Why does a website redesign cause rank drops even without content changes?
  4. 1:38 Does migrating to JavaScript really affect SEO rankings?
  5. 3:40 Hreflang: Why does Google still stress this tag for multilingual content?
  6. 3:40 Does Googlebot really see every localized version of your pages?
  7. 3:40 Does hreflang really group your multilingual content in Google's eyes?
  8. 4:11 How can you make your hyper-local content URLs discoverable without sacrificing traffic?
  9. 4:11 How can you structure your URLs to enhance the discoverability of hyper-local content?
  10. 5:14 Can user personalization trigger a penalty for cloaking?
  11. 5:14 Could personalizing content for your users lead to a cloaking penalty?
  12. 6:15 Are Core Web Vitals really measured on users or bots?
  13. 6:15 Are Core Web Vitals really measured from Google bots or from your actual users?
  14. 7:18 Why isn’t schema markup enough to ensure rich snippets appear?
  15. 7:18 Why don't rich snippets show up even with valid Schema.org markup?
  16. 9:14 Is dynamic rendering really dead for SEO?
  17. 9:29 Should we ditch dynamic rendering for SSR with hydration?
  18. 11:40 How does the JavaScript main thread block interactivity on your pages according to Google?
  19. 11:40 How does the JavaScript main thread affect the indexing of your pages?
  20. 12:33 Can Google really overlook your critical tags in the battle between initial and rendered HTML?
  21. 15:50 Is it true that Googlebot doesn't click on buttons on your site?
  22. 15:50 Should you really be concerned if Googlebot doesn't click on your buttons?
  23. 26:58 Should you prioritize JavaScript performance for your real users over optimization for Googlebot?
  24. 28:20 Are web workers truly compatible with Google's JavaScript rendering?
  25. 28:20 Should you really be wary of Web Workers for SEO?
📅
Official statement from (5 years ago)
TL;DR

Google refers to any inconsistency between initial HTML and HTML rendered after JavaScript execution as "undefined behavior" — particularly for canonical, noindex, and title. This means: Google can randomly choose either version, unpredictably and variably across crawls. For an SEO practitioner, this is a major risk area that must be systematically eliminated to maintain control over indexing.

What you need to understand

What does "undefined behavior" mean for a search engine?

The term "undefined behavior" comes from computing terminology: it refers to a situation where the outcome of a process is not guaranteed, documented, or stable. In the context of crawling and indexing, this means that Google does not commit to any specific rules regarding which of two conflicting values it will choose.

Specifically, if your raw HTML (the version seen by Googlebot before JavaScript execution) indicates a canonical tag pointing to page A, but after JavaScript rendering the tag points to page B, Google could take A, B, or alternate from one crawl to another. This is a major instability risk that can lead to partial de-indexing or contradictory signals being sent to the algorithm.

Why does the inconsistency between initial and rendered HTML present a structural problem?

Google uses a two-step rendering process: a first pass reads the raw HTML, and then a second pass — often delayed by several days — executes the JavaScript and analyzes the final DOM. If these two layers diverge on critical tags (canonical, robots meta, hreflang, title), the engine ends up with two sets of contradictory instructions.

The problem is not just theoretical. There are frequent cases where a page is indexed then de-indexed, where the title oscillates between two versions, or where a canonical is intermittently ignored. These inconsistencies create noise in the signals sent to the algorithm and can degrade rankings without the SEO clearly identifying the cause.

Which tags are particularly sensitive to this issue?

Martin Splitt explicitly cites canonical, noindex, and title, but the logic applies to any tag that influences indexing or ranking. Meta robots tags (noindex, nofollow), hreflang, client-side redirects (meta refresh, JavaScript redirect), and even structured data can be affected.

In practice, whenever a critical value is injected or modified by JavaScript, you need to check if it differs from the initial HTML. And if it does, always favor the initial HTML to avoid any ambiguity.

  • Initial HTML and rendered HTML must be strictly consistent on canonical, noindex, title, hreflang
  • Google guarantees no priority rule in case of inconsistency — the choice is random and variable
  • JS frameworks (React, Vue, Angular) are particularly exposed if SSR or prerendering is misconfigured
  • Testing with Google Search Console (URL inspection tool) and comparing raw HTML vs rendered HTML is essential

SEO Expert opinion

Does this statement really reflect the behavior observed in the field?

Yes, and that’s precisely what makes it a critical alert. For years, there have been unexplained fluctuations on SPA or hybrid sites: indexed pages that are then de-indexed, titles that change from one crawl to the next, canonicals that are intermittently ignored. The phrasing "undefined behavior" officially confirms what practitioners have empirically observed.

However, Google remains vague on a crucial point: is there an implicit priority logic? For example, if the initial HTML says "noindex" and the rendered version says "index," does Google consistently lean towards the more restrictive version? [To be verified] — no official documentation confirms this, and field reports are contradictory.

What concrete cases illustrate this risk of inconsistency?

The most common case concerns client-side JavaScript frameworks where the title, meta description, or canonical is injected after the first paint. If the initial HTML contains a generic title or a default canonical, and JavaScript modifies them, Google may index the initial version despite the final render.

Another scenario involves client-side A/B tests that modify content after loading. If a canonical tag or a meta robots tag is added or modified by the test, Google may detect it during rendering and ignore the initial instruction — or the other way around, depending on the crawling phase. It’s this unpredictability that makes the situation dangerous.

Are there exceptions where this rule can be softened?

For purely cosmetic elements — for instance, a span injected by JS with no SEO impact — inconsistency clearly has no consequence. But whenever it involves any tag read by Googlebot (head, meta, link, structured data), the rule applies without exception.

Some SEOs believe that the final render "always prevails" over the initial HTML. This is false. Google has repeatedly confirmed that the rendering process is asynchronous, delayed, and not guaranteed. If rendering fails or is delayed, it’s the initial HTML that takes precedence. Hence, it’s crucial never to rely solely on JavaScript for critical instructions.

Practical impact and recommendations

What should you prioritize checking on your pages?

Your first reflex should be to systematically compare raw HTML and rendered HTML for every critical template. Use Google Search Console's URL inspection tool, which displays side by side the HTML as crawled and the HTML as rendered. Any divergence on canonical, noindex, title, hreflang must be corrected before deployment.

Next, automate this verification in your CI/CD pipeline or your SEO audits. Tools like Puppeteer or Screaming Frog (JavaScript mode) allow you to detect these inconsistencies in bulk. The goal: never let a page that has JS modifying a critical tag absent or different in the initial HTML go into production.

How to correct an inconsistency already in production?

The most robust solution: Server-Side Rendering (SSR) or Static Site Generation (SSG). In both cases, the initial HTML already contains the correct values, and JavaScript no longer needs to inject them. If SSR/SSG is not feasible, server-side prerendering (via Rendertron, Prerender.io, or equivalent) remains a viable alternative.

If you stick to full client-side rendering, make sure critical tags are present in the initial HTML — even if their content is generic — and then updated by JavaScript without value divergence. For example, if the initial title is "Default Page" and JS changes it to "Optimized Title", Google may index "Default Page". Better to have the correct title in the raw HTML.

What mistakes should you absolutely avoid?

Never inject a canonical, noindex, or hreflang tag only via JavaScript. This guarantees unpredictable behavior. Similarly, avoid modifying the title after loading if the initial HTML contains a different title — Google may never see the final version.

Another common mistake: counting on rendering to "fix" a problem present in the initial HTML. For example, adding a noindex via JS to block indexing of a page that lacks an initial robots meta. Google may ignore this instruction if rendering is delayed or fails. Always prioritize the initial HTML for critical directives.

  • Compare raw HTML and rendered HTML via Google Search Console (URL inspection tool)
  • Check that canonical, noindex, title, hreflang are identical in both versions
  • Prefer SSR, SSG, or prerendering to eliminate any divergence
  • Automate detection of inconsistencies in your SEO audits or CI/CD pipelines
  • Never inject critical tags only via JavaScript
  • Test each template after modification to confirm HTML consistency between initial and rendered
Let’s be clear: eliminating these inconsistencies requires a deep understanding of front-end architecture and server-side rendering. If your tech stack relies on modern JS frameworks and you lack dedicated resources to audit and correct these divergences, it may be wise to consult a specialized SEO agency that masters crawl, rendering, and indexing issues. Expertise in these areas can prevent months of unexplained fluctuations and secure your visibility long-term.

❓ Frequently Asked Questions

Google privilégie-t-il systématiquement le HTML initial ou le HTML rendu en cas d'incohérence ?
Non, c'est justement le problème : Google qualifie ce cas de "comportement indéfini", ce qui signifie qu'il peut choisir l'une ou l'autre version de manière imprévisible et variable d'un crawl à l'autre.
Quelles balises sont concernées par cette problématique HTML initial vs rendu ?
Toutes les balises critiques pour l'indexation et le classement : canonical, robots meta (noindex, nofollow), title, hreflang, et dans une moindre mesure structured data et redirects côté client.
Le Server-Side Rendering (SSR) élimine-t-il totalement ce risque ?
Oui, si le SSR ou le SSG est correctement configuré : le HTML initial contient déjà les bonnes valeurs, et il n'y a donc plus d'incohérence possible avec le rendu JavaScript.
Peut-on détecter ces incohérences avec Google Search Console ?
Oui, l'outil d'inspection d'URL affiche côte à côte le HTML brut et le HTML rendu. C'est le moyen le plus fiable pour identifier les divergences sur les balises critiques.
Est-il risqué d'injecter un title ou une canonical uniquement via JavaScript ?
Absolument, car si le HTML initial contient une valeur différente (ou aucune valeur), Google peut ignorer la version JavaScript et indexer la version initiale, créant des incohérences imprévisibles.
🏷 Related Topics
Content Crawl & Indexing AI & SEO

🎥 From the same video 25

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