NeovaPlateforme SEO avancée

Canonique définie uniquement par JavaScript

Dans Neova S'exécute quand le crawl effectue le rendu des pages dans Chrome, un réglage à activer.

Règle revue le 17 octobre 2026 · Guide mis à jour le 7 juillet 2026

La canonique n'existe qu'après le rendu. Google documente ce cas comme un repli pris en charge : c'est donc un risque à examiner, pas un échec. Les crawlers qui n'exécutent pas JavaScript ne la voient jamais.

Ce que vous pouvez faire

Placez la canonique dans le HTML brut ou dans un en-tête de réponse Link.

Pourquoi Neova le signale

  • Google peut prendre en compte une canonical ajoutée par JavaScript, mais seulement quand il effectue le rendu de la page.
  • Les crawlers et outils qui n'exécutent pas JavaScript ne la voient jamais.
  • Le guide JavaScript de Google présente le HTML comme le meilleur moyen de définir la canonical.

Sources

Le guide complet

Cette partie est en anglais pour l'instant.

The Short Version

This flags when the raw HTML Google downloads has no rel="canonical", and the tag only appears after JavaScript runs and builds the rendered DOM. Google can process JS-injected canonicals, but it does so in a later, slower, best-effort pass, so a canonical that exists only after render is a canonical that might be missed, delayed, or overridden in the meantime.

The Two-Wave Problem

Google crawls in roughly two phases. The first wave parses the raw HTML response the instant it arrives, the exact bytes you'd see with curl, before a single line of JavaScript executes. The second wave, rendering, happens later when resources free up, and only then does client-side JS get a chance to inject or rewrite the canonical. If your canonical lives only in that second wave, it's absent for the entire window between fetch and render.

During that gap Google may make an indexing or canonicalization decision on a page it believes has no canonical, falling back to its own selection, exactly as if the tag were missing. When the rendered canonical finally lands it can reconcile, but you've introduced a race condition into something that should be deterministic. Other engines and AI crawlers are stricter still: many read raw HTML only and never see a rendered-DOM canonical at all.

Why It Matters

A canonical that depends on rendering is fragile in ways an HTML-head canonical never is. If the JS fails to execute, a script error, a blocked bundle, a timeout, a disallowed JS file in robots.txt, the canonical simply never appears, and the page is canonicalized by guesswork. Even when rendering succeeds, the delay means duplicate URLs can get indexed in the interim and the wrong version can win the first round. Crawlers that don't render JavaScript (a large share of non-Google bots and LLM fetchers) treat the page as having no canonical, full stop. You've made a critical indexing signal contingent on a fragile, deferred process for zero benefit.

Raw vs. Rendered: Seeing the Gap

The whole diagnosis is one comparison. The raw response is empty of canonical:

$ curl -s -A 'Mozilla/5.0' https://example.com/page/ | grep -i canonical
# (no output, nothing in the raw HTML)

But the rendered DOM, after JS runs, has one:

<!-- present only after a script executes, e.g. -->
<script>
  var l = document.createElement('link');
  l.rel = 'canonical';
  l.href = 'https://example.com/page/';
  document.head.appendChild(l);
</script>
<!-- resulting rendered DOM: -->
<link rel="canonical" href="https://example.com/page/">

The fix is to move the declaration into the raw HTML head so it's present in the first byte of the response, no rendering required:

<!-- server-rendered, in the initial HTML <head> -->
<head>
  <link rel="canonical" href="https://example.com/page/" />
</head>

Where the Canonical Lives vs. How Reliable It Is

Delivery Method In Raw HTML? Seen by Non-Rendering Bots? Reliability
Server-rendered head tag Yes Yes Highest, deterministic, first wave
HTTP Link: header Yes (in headers) Yes High, but avoid pairing with a conflicting tag
SSR/prerendered then hydrated Yes, if SSR emits it Yes High, verify SSR output, not just the client
JS-injected (this check) No No Low, deferred, race-prone, invisible to many bots

How to Detect It

  1. curl vs. View Rendered Source. The definitive test: curl -s -A 'Mozilla/5.0' URL | grep -i canonical for the raw HTML, then load the URL through a "View Rendered Source" extension or DevTools and check the rendered DOM. Canonical absent in one and present in the other = this exact flag.
  2. GSC URL Inspection → View Crawled Page + rendered HTML. Inspect the live URL, open the rendered HTML, and see whether Google's render picked up the canonical. Compare against the crawled raw response; if the canonical only shows in the rendered version, confirmed.
  3. Screaming Frog with JS rendering toggled. Crawl once in text-only mode and once with JavaScript rendering enabled. A canonical that appears only in the rendered crawl, and is blank in the raw crawl, is the fingerprint. Frog surfaces this under its JavaScript issue group.
  4. Disable JavaScript and reload. Turn JS off in the browser, load the page, and view source. If the canonical vanishes, it was never in the HTML to begin with.

How to Fix It

  1. Emit the canonical server-side so it's in the initial HTML response's <head> before any JS runs. This is the whole fix, everything else is verification.
  2. If you're on a JS framework, move the canonical into the SSR/SSG output (the framework's head manager) rather than injecting it client-side after mount.
  3. As an alternative, set the canonical via the HTTP Link: response header at the server or CDN, just don't also emit a conflicting head tag.
  4. Remove the client-side injection script so you don't end up with two sources fighting each other.
  5. Re-crawl in text-only mode and confirm the canonical is now present in the raw HTML, then re-inspect in GSC to confirm the crawled (not just rendered) page carries it.

FAQ

Google Renders JavaScript Now, so Does This Even Matter?

It does, because rendering is deferred and best-effort, not guaranteed or immediate. A raw-HTML canonical is processed in the first crawl wave with zero dependencies; a JS canonical waits for the render queue and can be skipped if a script fails. You're trading a deterministic signal for a probabilistic one, and getting nothing in return.

What If My Whole Site Is a JavaScript SPA?

Then render the canonical server-side through SSR or static generation so it's baked into the HTML you serve, not appended after hydration. Modern frameworks all have a head-management path that runs during SSR, use it. Client-side injection after mount is the pattern this check exists to catch. See the JavaScript SEO rendering guide for the full picture.

Will Non-Google Crawlers See My Rendered-DOM Canonical?

Usually not. Bing renders selectively, and most SEO tools, social scrapers, and AI/LLM fetchers read raw HTML only. A canonical that exists solely in the rendered DOM is invisible to that entire population, which increasingly matters as AI crawlers grow.

My JS Injects the Canonical Reliably in Testing. Isn't That Good Enough?

Reliable in your browser isn't the same as reliable in Google's render queue under load, or in a bot that doesn't run JS at all. "Works when everything goes right" is a weak guarantee for a signal that decides which URL gets indexed. Put it in the HTML and remove the variable.

Is a Rendered-DOM Canonical Better Than No Canonical?

Marginally, for Google specifically, since it does render. But it's strictly worse than an HTML-head canonical and it hides the fragility behind "it worked in the render." The correct state isn't "rendered canonical", it's "canonical in the raw HTML." Aim there.

See the canonical tag glossary and Canonical Tags reference for placement rules. Rendering is the core issue here, so pair with the JavaScript SEO rendering guide and, if a blocked bundle is the cause, the disallowed JavaScript file check. If you'd rather serve it via headers, read why the rel="canonical" HTTP header is faster.

Trouvez ce problème sur votre site

Neova lance ce check et tous les autres à chaque crawl, puis rédige la correction sous forme de ticket pour votre équipe.

  • Application de bureau pour Mac, Windows et Linux
  • Les 696 checks, chacun avec sa source
  • Search Console et Analytics 4, connectés en lecture seule
  • Tickets vers Jira, Linear et Asana

Télécharger Neova Offre Desktop Free, ou Solo gratuit pendant 14 jours, sans carte.

Tous les checks de la catégorie Indexabilité · Guides · Bibliothèque des checks

Rédigé par Neova Labs · Retour à la Bibliothèque des checks