Google supports several ways to declare a canonical. They are not interchangeable.
1. rel=”canonical” link element
In the <head>. The standard method for HTML pages. Use absolute URLs.
2. HTTP header
A Link: header with rel="canonical". The only option for non-HTML files such as PDFs.
3. Redirects
The strongest signal. When a duplicate should not be reachable at all, a 301 removes the ambiguity entirely.
4. Sitemaps
A weak signal on its own, but including only canonical URLs reinforces the others.
Common mistakes
- Every page canonicalising to the homepage, this de-indexes the site.
- Canonical pointing at a
noindexpage. - Canonical pointing at a URL that redirects somewhere else.
- Relative URLs that resolve differently than intended.
- Multiple conflicting canonical tags on one page, Google ignores all of them.
Alien Road recommends: crawl the site and check that every canonical target returns 200 and is self-referencing. A canonical chain, A points to B, B points to C, is treated as unreliable. It takes one crawl to find and is one of the highest-value fixes on any large site.