The same content often resolves at several URLs: with and without www, with
tracking parameters, through filtered category paths, or as a printer-friendly
copy. Google groups those duplicates and picks one representative URL to show in
search results. That process is called canonicalization, and the canonical tag is
the most direct way to state which URL you want chosen.
This guide follows Google's canonicalization overview and guide to consolidating duplicate URLs.
What the canonical tag is#
The canonical tag is a link element with rel="canonical". It goes in the
<head> of each duplicate and points to the preferred URL:
<head>
<title>Green dresses</title>
<link rel="canonical" href="https://www.example.com/dresses/green-dresses" />
</head>
Google only accepts the element when it appears in the <head>. A canonical
inside the <body>, often the result of a template that injects it into the
wrong slot or invalid markup that closes the head early, is ignored.
A hint, not a command#
Google states that "indicating a canonical preference is a hint, not a rule."
It weighs several signals to decide which URL is canonical, including whether the
page is served over HTTPS, redirects, sitemap inclusion, and rel="canonical"
annotations. When those signals disagree, Google may select a different URL from
the one you declared.
Try These Related SEO Tools
Google ranks the methods you control by strength:
| Method | Strength | Best use |
|---|---|---|
| Permanent redirect | Strong | Retiring a duplicate URL completely |
rel="canonical" link or header | Strong | Duplicates that must stay reachable, such as parameter or filtered URLs |
| Sitemap inclusion | Weak | Suggesting canonicals across a large site |
The signals stack, so the most reliable setup aligns all three: the canonical
URL is the redirect target, the value in every rel="canonical", and the only
version listed in the sitemap.
Implementation rules#
Use absolute URLs. Google recommends absolute paths such as
https://www.example.com/dresses/green-dress.html rather than
/dresses/green-dress.html. Relative values break easily when a page is served
from another host or protocol.
Add a self-referencing canonical. Google recommends a rel="canonical" link
on the canonical page itself. It costs nothing and protects the page when
tracking parameters or session IDs create unplanned copies.
Set it in the HTML source. Google asks that the canonical be present in the server-rendered HTML and that JavaScript not change it. If you can only set it with JavaScript, set it once and do not overwrite a server-provided value.
Keep one canonical per page. Plugins, themes, and frameworks can each emit their own tag. Two conflicting canonicals make the signal unreliable, so view the rendered source and confirm only one remains.
Canonicals for PDFs and other files#
Non-HTML files have no <head>, so send the canonical as an HTTP response
header. Google supports this for web search results:
Link: <https://www.example.com/downloads/white-paper.pdf>; rel="canonical"
This is useful when the same PDF is served from a CDN path and a site path, or when an HTML page and its PDF version carry the same content.
Mistakes that split signals#
- Blocking duplicates in robots.txt. Google cannot read the canonical on a page it is not allowed to crawl, and it "may still index URLs that are disallowed in robots.txt without their content." Let duplicates be crawled so the canonical can be seen. Our robots.txt guide covers what crawl blocking does and does not control.
- Using noindex to choose a canonical. Google advises against using
noindexto steer canonical selection within one site. Userel="canonical"or a redirect. - Mixing methods that disagree. A sitemap that lists one URL while the page's canonical names another sends opposite signals. Google warns against naming different canonicals for the same page through different techniques.
- Canonicalizing to a redirect, 404, or noindexed page. The target should
return
200, be indexable, and declare itself canonical. - Pointing every paginated page to page one. Page two of a category lists different items than page one, so it is not a duplicate. Google's pagination guidance says not to use the first page as the canonical for the sequence; give each page its own canonical URL.
- Using the URL removal tool. Google notes that it hides all versions of a URL from Search, not just the duplicate.
Language versions and hreflang#
Translated pages are not duplicates of each other. Google considers language
versions duplicates only "if the primary content is in the same language," so a
German page should not canonicalize to its English equivalent. Each language
version gets a self-referencing canonical in its own language, and hreflang
annotations connect the set. Google also notes that rel="canonical" links
carrying hreflang, lang, media, or type attributes are not used for
canonicalization.
Our canonical and hreflang tag manager prepares both sets of tags so they stay consistent.
How to check which URL Google chose#
Open the URL Inspection tool in Search Console and inspect a duplicate. Its indexing details show the user-declared canonical next to the Google-selected canonical. When they differ, look for conflicting signals: internal links pointing at the duplicate, a sitemap listing the wrong version, redirects that point elsewhere, or a canonical target that is thinner than the duplicate.
Canonical checks belong in every crawl review. The technical SEO audit guide shows where they fit with redirects, sitemaps, and indexing checks.
Don't Miss Our SEO Updates
Get the latest SEO tools and strategies delivered to your inbox.
No spam, unsubscribe anytime. We respect your privacy.
Related SEO Paths
About the Author
The Perfect SEO Tools team consists of experienced SEO professionals, digital marketers, and technical experts dedicated to helping businesses improve their search engine visibility and organic traffic.