A canonical tag is a <link rel="canonical"> element that tells search engines which URL is the main version of a page when the same or very similar content is reachable at several addresses. Google uses it as a strong hint, not a command: it picks one canonical URL per group of duplicates, indexes that one, and consolidates signals from the others onto it. Your job is to make every signal you control agree with the tag.
Why duplicates exist in the first place
Few sites create duplicate pages on purpose. The URL variants appear by themselves:
https://www.example.com/shoes
https://www.example.com/shoes/
https://www.example.com/shoes?utm_source=newsletter
https://www.example.com/shoes?sort=price
https://www.example.com/Shoes
https://example.com/shoes
http://www.example.com/shoes
https://m.example.com/shoes
https://www.example.com/shoes/index.html
To a crawler, each of those is a separate URL. Google groups pages with matching content, chooses a canonical for the group, crawls that one most often and shows it in results. Without guidance from you it will still choose, but perhaps not the URL you would have picked, and the links pointing at the variants are split across them until it sorts things out.
How to set a canonical
The HTML link element
Place it in the <head> of the duplicate page, pointing at the preferred URL. Place the same tag on the preferred page too, pointing at itself.
<head>
<link rel="canonical" href="https://www.example.com/shoes">
</head>
Requirements that get missed:
- It must be in the
<head>. A canonical in the<body>is ignored. Watch for scripts or invalid tags high up in the head that cause the parser to close the head early, which pushes everything after them into the body. - Use an absolute URL with protocol and host. Relative URLs are allowed but are an easy source of mistakes, for example when a staging host leaks in or a base path changes.
- One canonical per page. If a theme and a plugin both output one and they differ, Google is likely to ignore both.
- Fragments are not supported as canonical targets (
/shoes#reviewsis treated as/shoes).
The HTTP header
For files with no HTML head, such as PDFs, send the canonical as a response header:
Link: <https://www.example.com/downloads/size-guide.pdf>; rel="canonical"
nginx:
location = /files/size-guide-v2.pdf {
add_header Link '<https://www.example.com/downloads/size-guide.pdf>; rel="canonical"';
}
Apache:
<Files "size-guide-v2.pdf">
Header add Link '<https://www.example.com/downloads/size-guide.pdf>; rel="canonical"'
</Files>
Redirects and sitemaps
Google lists the canonicalization methods by strength:
| Method | Strength | Use when |
|---|---|---|
| Redirect (301 or 308) | Strong | The duplicate URL has no reason to exist for users |
rel="canonical" link element or header |
Strong | Users need both URLs to keep working (parameters, print views, syndication) |
| Sitemap inclusion | Weak | Always, as supporting evidence: list only canonical URLs |
If a variant does not need to be visited by anyone, redirect it. HTTP to HTTPS, non-www to www, uppercase to lowercase and index.html to the directory are all redirect jobs, not canonical jobs. See 301 vs 302 redirects.
The signals Google weighs
The tag is one vote among several. Google also looks at:
- Redirects between the URLs.
- Internal links: which version does your own site link to?
- Sitemap entries: which version did you list?
- HTTPS: Google prefers HTTPS URLs over HTTP by default.
- hreflang annotations: which URLs are in the language cluster?
- Content similarity: are the pages really duplicates?
When the tag says A, and the sitemap, navigation and hreflang all say B, expect Google to pick B. Most "Google ignores my canonical" cases come down to the site itself contradicting the tag.
How to check what Google chose
In Search Console, inspect the URL. Under Page indexing you will see two fields:
- User-declared canonical: what your tag says.
- Google-selected canonical: what Google uses.
If they match, you are done. If they differ, the Page indexing report files the URL under "Duplicate, Google chose different canonical than user". If you declared nothing and Google picked another URL, it appears under "Duplicate without user-selected canonical". And when your tag points elsewhere and Google agrees, the page is listed as "Alternate page with proper canonical tag", which is a normal, healthy state. Each has its own article: duplicate without user-selected canonical and alternate page with proper canonical tag.
To check the tag itself on a live page, including the HTTP header variant, use the Canonical Tag Checker.
Patterns for common situations
Tracking and session parameters
Self-referencing canonical on the clean URL, which every parameter variant then inherits because the tag is part of the template:
<!-- served at /shoes?utm_source=newsletter -->
<link rel="canonical" href="https://www.example.com/shoes">
Make sure the tag is built from the clean path and not from the requested URL. A canonical that echoes whatever URL was requested, parameters included, is self-referencing on every variant and therefore useless.
Sorting and filtering
Sort orders (?sort=price) show the same items in a different sequence. Canonicalise them to the unsorted URL. Filters are a judgement call: a filter that produces a page people search for ("red running shoes") may deserve its own indexable URL, while combinations of five filters do not. If filtered URLs number in the hundreds of thousands, canonical tags alone will not stop Google from crawling them. That is a crawl control question, covered in faceted navigation and indexing.
Pagination
Each page in a paginated series has different content, so each should have a self-referencing canonical. Pointing page 2, 3 and 4 at page 1 is a common mistake: the pages are not duplicates, Google may ignore the hint, and if it does honour it, the items linked only from deeper pages lose a crawl path.
Product variants
If colour or size variants have their own URLs with nearly identical content, choose one as canonical (usually the parent or the most popular variant) and point the others at it. If variants differ enough that people search for them separately, let them stand alone with self-referencing canonicals.
Syndicated content
When another site republishes your article, ask for a cross-domain canonical to your original:
<!-- on partner.example.net -->
<link rel="canonical" href="https://www.example.com/blog/original-article">
Google notes that syndication partners blocking indexing of their copy is the more reliable way to avoid being outranked by it, since a cross-domain canonical is still a hint and the pages often differ considerably around the article body.
JavaScript sites
Put the canonical in the server-delivered HTML. Google can pick up a canonical injected with JavaScript after rendering, but if the initial HTML contains one value and JavaScript changes it to another, you have created conflicting signals. Never ship a default canonical (for example, the homepage) in the HTML shell and "correct" it on the client. More in JavaScript SEO.
Mistakes that break canonicals
Canonical to a URL that is not indexable. The target returns 404, redirects, is blocked by robots.txt or carries noindex. The target must be a 200, indexable, self-canonical page.
Every page canonicalised to the homepage. Usually a template bug. Google will mostly ignore it because the pages are not duplicates, but while it is live, you are asking for your pages to be dropped.
Canonical chains. A points to B, B points to C. Point everything directly at C.
Blocking the duplicate in robots.txt. Google cannot read a canonical on a page it may not fetch. If you want consolidation, the duplicate has to be crawlable.
Using canonical for pages that are not duplicates. Pointing a thin page at a strong one in the hope of passing value does not work. When content differs substantially, the hint is disregarded.
Protocol or host mismatch. The site runs on https://www. and the canonical says http:// or drops the www. One wrong character in a template means every page on the site points at a redirecting URL.
Internal links to non-canonical URLs. Navigation that links to /shoes/ while the canonical says /shoes weakens your own signal on every page. Crawl your site and fix links so they target canonical URLs directly.
Mixing canonicals and hreflang incorrectly. Each language version should canonicalise to itself, and hreflang should reference those canonical URLs. Canonicalising the German page to the English one tells Google to drop the German page, which defeats the annotations. See the hreflang guide.
Using the Removals tool or noindex to pick a canonical. Google specifically advises against both. The Removals tool hides all versions of the URL from results, and noindex removes a page instead of consolidating it.
A quick audit routine
- Crawl the site and export each URL with its canonical, status code and indexability.
- Flag pages with no canonical, more than one canonical, or a canonical target that is not a 200 indexable page.
- Flag canonical targets that differ from the URL only by protocol, host, case or trailing slash. Those should be redirects.
- Compare the sitemap with the canonical targets. Every sitemap URL should be self-canonical.
- In Search Console, review the two "Duplicate" rows of the Page indexing report and sample the URLs with URL Inspection to see which canonical Google selected and why your signals disagreed.
Canonicalization rewards consistency more than cleverness. Pick one URL format, redirect what you can, tag what you cannot, and make your links, sitemap and hreflang repeat the same answer.
Frequently asked questions
- Is the canonical tag a directive or a hint?
- A hint. Google treats rel=canonical as a strong signal, and combines it with other signals such as redirects, internal links, sitemap entries and HTTPS. If those point at a different URL, or if the two pages are not actually duplicates, Google may choose another canonical.
- Should every page have a self-referencing canonical?
- Google recommends it. A self-referencing canonical makes your preferred URL explicit when the page is reached through tracking parameters, mixed case or other variants that you did not plan for.
- Can a canonical tag point to another domain?
- Yes. Cross-domain canonicals are supported and are the usual way to handle syndicated content, where the republished copy points back to the original article. The pages need to be the same or very similar content.
- Can I combine noindex and a canonical to another page?
- Avoid it. The canonical says this page is equivalent to another URL, and noindex says this page should not be in the index. The signals conflict, and Google advises against using noindex for canonicalization. Choose one.
- Does a canonical tag pass link signals like a 301 redirect?
- When Google accepts the canonical, signals from the duplicate URLs are consolidated on the canonical URL, similar to a redirect. The difference is that users can still visit the duplicate, and Google is free to disregard the hint.