SEOscanner.app

Rule · JavaScript

The canonical is set in HTML and not changed by JavaScript

SEO-JS-01C2 Recommended· w4

Class
C2 Recommended
Weight
4
Severity on fail
major
Applies to
Google

Scope and evidence

Evaluated on page (P). The book marks this requirement DOCUMENTED RECOMMENDATION, SEARCH-ENGINE-SPECIFIC. It needs rendered; without that input the rule reports as not evaluated rather than guessing.

Fail conditions

Each condition has a stable code and a reason template. The evaluator fills the placeholders from observed values only; no sentence in a report is generated.

  • canonical_added_by_js

    On {url}, the canonical ({rendered}) exists only after JavaScript runs. Google says the best way to set the canonical URL is to use HTML.

  • canonical_changed_by_js

    On {url}, JavaScript changes the canonical from {raw} to {rendered}. Google says that if JavaScript must set the canonical, it should always be the same value as in the original HTML.

The documented fix

Render the canonical on the server and leave it unchanged in the client.

Sources, quoted

These are the passages the rule rests on, stored once in the knowledge base and emitted exactly as written. A citation marked for specific conditions appears only on findings with those codes.