Canonical in HTTP Header vs HTML Link: One Signal, Not Two
HTTP Link canonical vs HTML rel=canonical: Header-Then-HTML. One preferred URL—do not let header and head tag disagree. Official Google notes.

Canonical in HTTP header form looks like Link: <https://example.com/page/>; rel="canonical" on the response. HTML link form is the familiar <link rel="canonical" href="…"> in the head.
This page is Header-Then-HTML. It is not Google canonical tag explained (definition and checklist). It is not duplicate canonical tags on one page (two HTML tags). It is not canonical vs 301 (hint versus permanent move).
Pick one channel or make both name the same absolute URL. A header that points at http:// while HTML points at https:// is the same class of bug as two HTML tags at war.
Official: Consolidate duplicate URLs — HTTP header method.
Table of contents
- Header-Then-HTML
- When each channel appears
- How to compare header and view source
- Small-blog default: HTML is enough
- When headers matter more
- Align with redirects and host policy
- FAQ
- curl one URL you care about
Header-Then-HTML
HEADER-THEN-HTML
HTML only → one rel=canonical in <head> (typical blog post)
Header only → some PDF/API stacks (confirm crawler access)
Both → OK only when both hrefs match exactly
Never → header → A, HTML → B
Proof → curl -I + view source + URL Inspection
Google lists both methods in the same consolidation guide. Neither method is a command—both are hints that fail when the rest of the site sends mixed signals.
When each channel appears
HTML link — default for WordPress, Ghost, and most CMS themes via SEO plugins. Editors can see it in view source without terminal access.
HTTP header — common on:
- PDF and document URLs served directly
- Some enterprise CDNs that inject
Linkheaders - Custom app routes that do not render a full HTML shell
- Misconfigured plugins that add headers and HTML without syncing
If you only manage a blog theme, you may never intentionally set a header canonical. You still need to know headers exist when a host support ticket says "we added Link canonicals."
How to compare header and view source
On a live URL:
-
View source — find
<link rel="canonical" href="…">. -
curl -I — on Windows PowerShell:
curl.exe -I https://yoursite.com/blog/slug/and read theLink:line if present. -
Compare absolute URLs — scheme, host, path, trailing slash.
https://www.example.com/a/andhttps://example.com/aare not "close enough" if your site policy picked one host. -
URL Inspection — user-declared canonical should match what you intended. If Google-selected differs, fix signals before you write new content—see Google-selected canonical.
Do not assume the SEO plugin UI shows header output. Many plugins only manage HTML.
Small-blog default: HTML is enough
For a typical CashPilot-style blog post:
- One SEO plugin canonical on the pretty permalink
- Sitemap lists the same URL
- Internal links use the same URL
- One host URL policy already settled www and slash
Adding a header canonical "for SEO" without engineering review often duplicates work and introduces drift when the plugin updates the HTML tag but the CDN rule still injects yesterday's host.
If your host injects headers automatically, ask whether you can disable them for HTML documents or sync them from the CMS.
When headers matter more
Non-HTML resources and headless setups deserve a separate checklist:
- PDFs linked as direct downloads may not have an HTML head. Header or metadata strategies depend on how Google accesses the file—confirm current docs for non-HTML URLs.
- API or JSON responses should not accidentally send HTML canonical headers on error pages—another source of soft confusion in Crawl Stats.
For normal articles, keep the mental model simple: HTML canonical on the keeper URL. Headers are the edge case, not the first lever.
Align with redirects and host policy
A header canonical to http:// while the site 301s to https:// trains the same mess as mismatched HTML tags. Fix host and redirect policy first—see canonical vs 301.
Pagination, UTM parameters, and cross-domain syndication stay on their own owners. This page only prevents two channels on one response from naming different keepers.
FAQ
Can I send a canonical in an HTTP header?
Yes. Google documents header and HTML methods. Both are hints.
What if the header and HTML tag disagree?
Align to one absolute URL or remove the duplicate channel.
Is this the same as duplicate HTML canonical tags?
Related. See the duplicate-tags owner for two HTML emitters.
Do I need header canonicals on normal blog posts?
Usually HTML from the SEO plugin is enough.
How do I see the header canonical?
curl -I and read the Link header line.
Is a header canonical stronger than HTML?
No guaranteed override—consistency wins.
Should PDFs use header canonicals?
Non-HTML files may rely on headers; confirm Google's non-HTML guidance.
Where is the official documentation?
curl one URL you care about
Take a post that already shows duplicate or parameter URLs in Search Console. View source for the HTML canonical. curl -I for a header. If both exist, they must match character for character on the absolute URL you want indexed. If only one exists, leave it that way unless your stack requires headers. Header-versus-HTML fights are quiet until Inspection shows Google picked a URL you did not intend.
Keep learning
More guides in the same topic lane.
Word to PowerPoint Online Free: Slides From a DOCX, Not a Redesign
Word to PowerPoint online free: lift a DOCX into editable PPTX in the browser—working draft, not a design pass. CashPilot tool walkthrough.
Bulk WebP Converter Online Free: PNG and JPG to a ZIP
Bulk WebP converter online free: convert up to 50 PNG/JPG images to WebP and download a ZIP—browser job, not a Photoshop seat.
Regex Extractor Online Free: Pull Emails and URLs From Pasted Text
Regex extractor online free: paste messy text, pull emails, URLs, and phones—format extraction only, not inbox verification. CashPilot tool.