Sync HTML canonical tags and Link headers
Ensures consistency between HTML rel="canonical" tags and HTTP Link canonical-url headers.
- Ensure the `rel="canonical"` tag in your HTML matches the `Link` canonical-url header if both are used
- Avoid sending conflicting signals to search engines about the primary version of a page
- Maintain consistency across all methods of declaring your canonical URL
Rule Details
Consistency across all technical signals is crucial for ensuring search engines interpret your site's structure correctly. If the HTML canonical tag and HTTP Link header disagree, they create the same ambiguity addressed in canonical URL selection.
Code Example
# ✅ Good: HTTP Header and HTML tag provide the same URL
# HTTP Response Header:
# Link: <https://example.com/target-page>; rel="canonical"
# HTML <head> section:
# <link rel="canonical" href="https://example.com/target-page">Why It Matters
- Signal Reliability: Consistent signals ensure that search engines trust and follow your canonicalization instructions.
- Duplicate Content: Prevents different versions of a page from competing with each other in search results.
- Technical Integrity: Reduces the likelihood of "canonical-url mismatch" errors in Google Search Console (opens in new tab) reports.
- Predictable Indexing: Ensures that the URL you want to rank is the one that search engines actually choose.
Exceptions
- Staging, utility, login, account, or internal search pages may intentionally use different crawl or index signals if they are not meant to rank.
- Temporary migration states can produce noisy intermediate signals; flag the live production URL pattern, not one-off transition artifacts.
- When redirects, canonicals, robots directives, or indexability signals conflict, fix the strongest final signal first instead of reporting every downstream symptom as a separate blocker.
Standards
- Use these references as the standard for the final search-facing HTML, metadata, and crawl behavior.
- Check the implementation against Google Search Central: Search Essentials before treating the rule as satisfied.
- Check the implementation against Google Search Central documentation before treating the rule as satisfied.
Verification
Automated Checks
- Inspect rendered HTML and HTTP headers to confirm the expected metadata or crawlability signal is present.
- Test the affected URL with Google Search Console or equivalent tooling where relevant.
- Re-crawl a representative page set after deployment.
Manual Checks
- Confirm the change does not create conflicting canonical-url, robots, or structured-data signals.
Use with AI
Copy these prompts to use with your AI assistant, or install the MCP server to use directly from Claude, Cursor, or Windsurf.
Check
Verify implementation
Compare the HTML canonical tag with the HTTP Link header to ensure they point to the exact same URL.
Fix
Auto-fix issues
Update either the HTML tag or the HTTP header so that they provide a consistent canonical URL signal.
Explain
Learn more
Explain the risks of sending conflicting technical SEO signals to search engine crawlers.
Review
Code review
Review metadata generation, rendered HTML, structured data, and response headers related to Sync HTML canonical tags and Link headers. Flag exact routes or templates where search-facing output violates the rule, and describe how to verify the final page output.