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

Canonical tags and links in the initial HTML headers are taken into account, but not the versions rendered via JavaScript. Critical changes must be delivered in the static HTML code.
31:44
🎥 Source video

Extracted from a Google Search Central video

⏱ 54:18 💬 EN 📅 17/05/2018 ✂ 23 statements
Watch on YouTube (31:44) →
Other statements from this video 22
  1. 2:37 Is interlinking multiple web projects risky for SEO?
  2. 3:41 Does the hreflang attribute really influence the ranking of your international pages?
  3. 6:00 Does geotargeting really affect your site's local ranking?
  4. 10:21 Have links really lost their importance for ranking?
  5. 13:12 Do social signals really influence Google rankings?
  6. 13:26 Does Mobile First Indexing really work without mobile optimization?
  7. 13:44 Why isn't your site regaining its ranking after a manual penalty has been lifted?
  8. 14:34 How does Google really choose the canonical version of a page when faced with duplicate content?
  9. 16:15 Does Google Cache really reveal the mobile-desktop differences that affect your ranking?
  10. 17:42 Does mobile-first indexing mean that Google punishes sites that are not optimized for mobile?
  11. 19:34 Should you really implement hreflang on all multilingual sites?
  12. 23:41 Does the canonical tag really override all your product variations?
  13. 25:10 Can Google really exclude your pages from results because of soft 404s?
  14. 25:20 Can soft 404 pages for out-of-stock products really hurt your rankings?
  15. 27:12 Do social signals really affect organic search rankings?
  16. 29:38 Do links to a canonicalized page lose their SEO value?
  17. 36:40 Should you still optimize the length of your meta descriptions for Google?
  18. 50:01 Can you block MP4 video files in robots.txt without risking SEO penalties?
  19. 60:20 Should you really optimize the length of your meta descriptions?
  20. 70:24 Why does Search Console show some resources as blocked when they're supposed to be accessible?
  21. 73:40 Does Google really index raw JSON responses?
  22. 75:16 Does the initial static HTML of a SPA determine its indexing?
📅
Official statement from (8 years ago)
TL;DR

Google confirms that canonical tags and HTTP headers added or modified via JavaScript after the initial load are not considered for SEO. Only the versions present in the raw HTML before rendering count. Practically, this means that all critical SEO parameters must be delivered server-side, without relying on a JavaScript framework for injection.

What you need to understand

Why is there a distinction between initial HTML and JavaScript rendering?

Google crawls and indexes pages in two distinct phases. The raw HTML is analyzed first, before any JavaScript processing. Canonical tags, Link headers with rel="canonical", and other critical directives must be included in this initial server response.

If your framework (React, Vue, Angular, Next.js) injects these elements later via JavaScript, Google may see them during deferred rendering, but will not apply them. The bot does not trust post-load modifications for canonicalization or redirection directives.

What elements are affected by this strict rule?

Canonical tags (<link rel="canonical">) and HTTP Link headers must be present in the initial server response. This also applies to redirection headers, hreflang directives, and potentially some cache or security headers.

Metadata added dynamically (title, meta description, Open Graph) may work in JavaScript for social display, but for strict SEO, it is better not to rely solely on deferred rendering. Google can index before complete rendering.

How can you verify what Google sees in raw HTML?

Use curl -I or wget --server-response to inspect the raw HTTP headers. For the initial HTML, disable JavaScript in Chrome DevTools (Cmd+Shift+P > Disable JavaScript) and reload the page.

If your canonicals disappear without JS, you have a problem. The URL inspection tool in Search Console displays both the raw HTML and the rendering, but does not always clearly show which element comes from which phase.

  • Canonical tags must be present in the source HTML before any script
  • HTTP Link headers (rel="canonical") must be included in the initial server response
  • Any critical element for crawling or indexing must not depend on JavaScript for its existence
  • Modern JavaScript frameworks require server-side rendering (SSR) or static pre-generation to ensure the presence of these elements
  • Pure Single Page Applications (SPAs) are particularly vulnerable to this issue if they do not use SSR

SEO Expert opinion

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

Yes, and it serves as a welcome reminder. Too many sites are migrating to JavaScript-first architectures without understanding that Google does not trust rendering for critical directives. We regularly see poorly configured Next.js or Nuxt sites losing their canonicalization for weeks.

The problem is that Google does render JavaScript for other aspects (content, internal links), which creates a legitimate confusion. Developers believe that if Google sees the rendered content, it also sees the rendered canonicals. This is false.

What are the unclear gray areas?

Google does not specify the exact timing. If a canonical appears after 50ms of JS but before the renderer passes, is it taken into account? [To verify] on real cases. Official documentation remains vague on the timing between the initial crawl and rendering.

Another point: changes to canonicals during a session (SPA navigation). If a user navigates from page A to page B without reloading, and the canonical changes via JS, does Google ignore this change during a subsequent crawl of that URL? Probably, but no official data explicitly confirms this.

In what cases does this rule cause the most problems?

E-commerce sites with dynamic filters are trapped. If your facets generate parameterized URLs and the canonical only points to the version without filter through JavaScript, Google might index all the variants.

Multilingual sites using client-side routing (SPA) to change language without SSR will lose their hreflang if these are injected post-render. Result: inter-language cannibalization and poor geographic targeting in SERPs.

Warning: Frameworks like Gatsby or Next.js in export static mode do well, but in pure SPA mode (CSR only), you are vulnerable. Check your build configuration.

Practical impact and recommendations

What should you do concretely to remain compliant?

First step: audit your tech stack. If you use React, Vue, or Angular, ensure that server-side rendering (SSR) or static generation (SSG) is enabled. Next.js with getServerSideProps or getStaticProps, Nuxt in universal mode, Angular Universal are your friends.

Second action: check that your canonical tags appear in the <head> of the raw source HTML. Test with curl, with JavaScript disabled, and via the URL inspection tool in Search Console. If they don’t appear in all three, you have an issue.

What errors should you absolutely avoid?

Never delegate the injection of canonicals to a JavaScript plugin or tag manager (GTM, Segment). These tools load too late in the page lifecycle. Google will have already read the raw HTML.

Avoid wobbly hybrid solutions where some pages use SSR and others pure CSR. This creates a processing inconsistency that complicates diagnosis and multiplies the risks of indexing errors.

How can you test that your implementation is working?

Use continuous monitoring of HTTP headers and raw HTML on your critical templates. A Lighthouse CI script or a Puppeteer test can automate the verification that the canonicals are present before any JS.

Systematically compare what you see in the browser (with JS) and what curl returns (without JS). If the difference is significant on critical SEO elements, correct it immediately server-side.

  • Enable server-side rendering (SSR) or static generation (SSG) for all strategic templates
  • Check that canonical tags appear in the raw HTML (curl test or JS disabled)
  • Configure HTTP Link headers rel="canonical" directly at the server level for critical pages
  • Audit your JavaScript frameworks: Next.js, Nuxt, Angular Universal must be correctly configured
  • Test with the URL inspection tool in Search Console for the presence of canonicals before rendering
  • Avoid injecting SEO directives via GTM, Segment, or any third-party tag manager
The rule is simple: everything that matters for crawling, indexing, or canonicalization must be present in the initial server response, without depending on JavaScript. Modern architectures (SPA, PWA) require SSR or SSG to ensure this presence. If your tech stack is complex or if you doubt the compliance of your current implementation, consulting an SEO agency specialized in JavaScript architectures can save you months of lost organic traffic and costly indexing errors.

❓ Frequently Asked Questions

Google prend-il en compte les balises canonical ajoutées via JavaScript ?
Non. Google analyse les canonicals présentes dans le HTML brut initial et les en-têtes HTTP, avant tout rendering JavaScript. Les canonicals injectées dynamiquement sont ignorées pour la canonicalisation.
Les sites en React ou Vue doivent-ils obligatoirement utiliser du SSR pour le SEO ?
Pas obligatoirement, mais fortement recommandé pour les éléments critiques (canonicals, hreflang, structured data). Une génération statique (SSG) fonctionne aussi. Le CSR pur (client-side rendering uniquement) est risqué pour le SEO.
Comment vérifier que mes canonicals sont présentes dans le HTML brut ?
Désactivez JavaScript dans Chrome DevTools et rechargez la page, ou utilisez curl/wget pour récupérer le HTML source. Si la balise canonical disparaît sans JS, elle n'est pas prise en compte par Google.
Les en-têtes HTTP Link rel="canonical" sont-ils plus fiables que les balises HTML ?
Ils ont le même poids pour Google, mais sont plus robustes car générés côté serveur par définition. Si votre CMS ou framework ne permet pas facilement les canonicals en HTML statique, les en-têtes HTTP sont une alternative sûre.
Peut-on utiliser GTM pour gérer les balises canonical ?
Non, c'est une erreur courante. GTM charge après le HTML initial et injecte via JavaScript. Google ignore ces canonicals pour la canonicalisation. Utilisez votre CMS ou votre serveur pour les générer.
🏷 Related Topics
Crawl & Indexing AI & SEO JavaScript & Technical SEO Links & Backlinks

🎥 From the same video 22

Other SEO insights extracted from this same Google Search Central video · duration 54 min · published on 17/05/2018

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