The same page is often reachable at several addresses. Search engines then have to decide which one is the real one. A canonical tag is how you tell them.
<link rel="canonical" href="https://example.com/shoes/running">
It goes in the <head> of the page, and it says: "if you find this content at other URLs, this is the one to index and show."
Where duplicates come from
Almost nobody creates duplicate content on purpose. It comes from how sites and servers work:
- http and https.
http://example.com/pageandhttps://example.com/page. - www and non-www.
www.example.com/pageandexample.com/page. - Trailing slashes.
/pageand/page/. Most servers treat these as different URLs. - Case.
/Pageand/page, on servers where paths are case-sensitive. - Parameters.
?utm_source=newsletter,?ref=partner,?sessionid=...,?sort=price,?colour=blue. Every combination is a new URL with the same or nearly the same content. - Index files.
/and/index.htmlor/index.php. - Shop structure. The same product under
/men/shoes/runnerand/sale/runner. - Printer and AMP versions, and copies on a staging subdomain that was never locked down.
Four of those, combined, can turn one page into a dozen URLs.
Is duplicate content a penalty?
No, not in the sense people fear. Google has said for years that ordinary duplication is not penalised. It groups the duplicates, picks one as canonical, and shows that one.
The cost is subtler:
- Google may pick a version you do not want, such as the one with a tracking parameter.
- Links and other signals are spread across several URLs instead of concentrated on one.
- Crawlers spend visits on copies instead of on new pages. On a large site that matters.
Canonical tags, redirects and consistent internal links fix all three.
Fix the site-wide variants with redirects
For http/https, www/non-www and trailing slashes, a canonical tag is the wrong first tool. These variants should not exist at all. Pick one form and send everything else to it with a 301 redirect at the server or CDN.
# nginx: send http and www to https://example.com
server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}
A redirect means the duplicate cannot be visited, linked or indexed. A canonical tag only asks search engines to prefer another URL while both stay live. Clearing broken links and redirect chains covers how to keep redirects to a single hop.
Then add canonical tags on top, for the variants you cannot redirect.
Use self-referencing canonicals everywhere
Every indexable page should carry a canonical tag pointing at its own clean URL.
<!-- On https://example.com/shoes/running -->
<link rel="canonical" href="https://example.com/shoes/running">
It looks redundant, but it handles everything you did not plan for. When a newsletter adds ?utm_campaign=autumn, or a partner links with ?ref=123, the page at that URL still says which version is the real one.
Most CMSs and frameworks can output this automatically. Check that they use the clean URL and do not copy the current URL, parameters included, into the tag.
Canonical, noindex or redirect?
They do different jobs, and mixing them up causes most canonical problems.
| You want | Use | Why |
|---|---|---|
| The duplicate to stop existing | 301 redirect | Visitors and crawlers both end up on one URL. |
| Both URLs live, one indexed | rel="canonical" |
Useful for parameters, sorting and tracking links. |
| A page out of search entirely | noindex |
For thank-you pages, internal search results, thin filter pages. |
| Crawlers not to fetch a URL at all | robots.txt | For crawl load only. It does not remove a URL from the index. |
Two combinations to avoid:
- Canonical plus noindex on the same page. One says "index that one instead", the other says "do not index this". Google has advised against sending mixed signals like this. Pick one.
- Blocking a duplicate in robots.txt. If Google cannot fetch the page, it cannot see its canonical tag. The URL may even be indexed without content, from links alone. The robots.txt guide covers what blocking does and does not do.
The mistakes that repeat
Every page canonicalised to the homepage. A theme or plugin setting fills in the site URL instead of the page URL. You are telling Google your whole site is one page, and it may drop the rest.
Canonical pointing at a URL that redirects, returns 404 or is noindexed. The target must be a live, indexable page that returns 200. Otherwise Google ignores the hint or follows it somewhere useless.
Two canonical tags on one page. Often one from the theme and one from an SEO plugin. If they disagree, Google may ignore both. View the page source and search for canonical.
Canonical added by JavaScript that differs from the HTML. Google reads both, and a conflict is ambiguous. Put the tag in the server-rendered HTML.
Paginated pages canonicalised to page one. Page 2 of a category lists different products from page 1, so it is not a duplicate. Each page in a series should point to itself.
Language versions canonicalised to each other. A French page is not a duplicate of the English one. Each should be self-canonical, with hreflang linking the versions.
Canonicals still pointing at the old domain after a migration, or at the staging site. Keeping rankings through a migration includes this in the checklist.
Internal links that disagree with the canonical. If the canonical says /shoes/running/ but every menu and link uses /shoes/running, you are sending two signals. Link to the canonical form, and list only canonical URLs in your sitemap. See the XML sitemap guide.
How to check what Google chose
In Search Console, open URL Inspection for the page. It shows the user-declared canonical, which is yours, and the Google-selected canonical. If they differ, Google is overriding you, usually because other signals point elsewhere.
The Page indexing report groups these under statuses such as "Duplicate, Google chose different canonical than user" and "Alternate page with proper canonical tag". The second is normal: it means a variant was correctly folded into its canonical. The first is the one to investigate. Why Google is not indexing your page covers the other statuses.
Rankwell's site audit flags pages with no canonical tag and pages whose canonical points to a different URL, so you can confirm each one is intentional.
Canonicals for files and other domains
For PDFs and other non-HTML files, send the canonical as an HTTP header:
Link: <https://example.com/guides/sizing>; rel="canonical"
If your article is republished on another site, ask them to add a canonical pointing to your original. Google treats it as a hint, as always, but it is the clearest signal you can give about which copy came first.