Skip to content

All checks / Technical

Canonical tag inconsistent in JavaScript page

Google has clarified that canonicalization happens both before and after rendering for JavaScript pages.

Warning canonical-javascript-best-practice

In SEOCode's checks since 9 May 2026


Why this matters.

Google has clarified that canonicalization happens both before and after rendering for JavaScript pages. To make the canonical URL as clear as possible: set the canonical URL in the original HTML to the same URL as the intended canonical. If that is not possible (e.g., the canonical is determined dynamically), leave the canonical tag out of the original HTML entirely rather than setting an incorrect one that conflicts with the post-render canonical.

Runs on .jsx .tsx .vue .svelte · Warnings are reported on the pull request but do not block the merge.


How to resolve it.

Ensure <link rel="canonical" href="https://example.com/page" /> in the original static HTML matches the canonical URL you intend. If the canonical is set dynamically via JavaScript, remove it from the original HTML to avoid conflicting signals.

SEOCode writes this fix for you

On a pull request the fix arrives as a suggestion you can commit in one click, when the change is unambiguous on the line.




Every check, on every pull request.

SEOCode runs the full ruleset on each change and comments the fixes inline.

Free for public repositories · no credit card