GitHub

Canonical Header Validation

Detects mismatch between HTML canonical tag and Link header

Detects mismatch between HTML canonical tag and Link header

Rule IDcore/canonical-header
CategoryCore SEO
ScopePer-page
Severitywarning
Weight7/10

Solution

When both HTML canonical tag and HTTP Link header are present, they must match. Search engines may get confused by conflicting signals.

HTML: <link rel="canonical" href="https://example.com/page"> HTTP: Link: <https://example.com/page>; rel="canonical"

Best practice: Use HTML canonical tag only. Only add Link header if unable to modify HTML (e.g., PDF files).

Enable / Disable

Disable this rule

squirrel.toml
toml
[rules]
disable = ["core/canonical-header"]

Disable all Core SEO rules

squirrel.toml
toml
[rules]
disable = ["core/*"]

Enable only this rule

squirrel.toml
toml
[rules]
enable = ["core/canonical-header"]
disable = ["*"]

Type to search…

↑↓ navigate ↵ open esc close