A canonical tag is a <link> element in a page's <head> that names the preferred URL for that page's content:
<link rel="canonical" href="https://example.com/dresses/green-dresses" />
It's also called rel canonical, after its attribute. The link relation was defined in 2012 in RFC 6596 as a way to mark the preferred version of a resource among duplicates.
You need one because the same content often lives at more than one URL. A product might be reachable at /shoes/red-sneaker, at /shoes/red-sneaker?utm_source=newsletter, at /sale/red-sneaker, and over both http and https. To you that's one page. To a search engine it can look like four. See duplicate content for how this happens.
What the tag does, and what it doesn't
Google groups duplicate URLs together and picks one, the canonical, to show in search results. The others are crawled less often. Declaring a canonical lets you tell Google which one you prefer, so that:
- the URL you want is the one people see in results,
- signals such as links to the duplicates count toward one URL (see link equity),
- your reports show one page's traffic instead of several, and
- Google spends less time crawling duplicates (see crawl budget).
Unlike a redirect, the duplicates stay reachable. A visitor who opens the ?utm_source= link still sees the page.
The tag is a strong signal, not an order. Google calls a canonical preference "a hint, not a rule" and may choose a different URL if other signals point elsewhere. Google Search Central
Ways to declare a canonical
Google reads several signals. Use more than one if you like, as long as they all point to the same URL.
| Method | How strong | Use it when |
|---|---|---|
| Permanent redirect | Strong | You're retiring the duplicate URL |
rel="canonical" link in the HTML <head> |
Strong | The duplicates must stay live, for HTML pages |
rel="canonical" in an HTTP Link header |
Strong | Files that aren't HTML, such as PDFs |
| Listing only the canonical in your sitemap | Weak | As backup for the other methods |
The header version looks like this, and Google supports it for web search results only:
Link: <https://www.example.com/downloads/white-paper.pdf>; rel="canonical"
Rules for a canonical Google can use
Google's guidelines, with one point from the standard itself:
- Use absolute URLs, with
https://and the domain, not/page/. - Put the tag in the
<head>. Google ignores a canonical link anywhere else, so check that nothing before it breaks the head, such as a stray tag. - Add a self-referencing canonical on the canonical page itself.
- Name the same URL everywhere. Don't put one URL in the tag and a different one in the sitemap or header.
- Link to the canonical in your menus and internal links.
- Don't change it with JavaScript. Put it in the HTML source.
- Don't point to a URL fragment (
#section). - Don't use robots.txt,
noindexor the URL removal tool to choose a canonical. Robots.txt hides the content but not necessarily the URL,noindexremoves the page from Search completely, and the removal tool hides every version. - Don't chain canonicals or point to an error page. RFC 6596 advises against targets that redirect, declare a canonical of their own, or return a 4xx error.
Common cases
| Situation | What to do |
|---|---|
| Tracking parameters such as UTM parameters | Canonical to the clean URL |
| A sorted or filtered list showing the same products as the main category | Canonical to the main category page |
Paginated pages (/blog/page/2/) |
Each page gets its own canonical. Google says not to point them all to page 1 |
http and https, or www and non-www |
Redirect to the one you keep |
| Same content for several countries in one language | Canonical plus hreflang |
| Your article republished on a partner's site | Ask the partner to block indexing of their copy. Google doesn't recommend a canonical for this |
That last row reverses older advice. Google now says the canonical link element isn't recommended for avoiding duplication by syndication partners, because the pages are often very different, and that the most effective solution is for partners to block indexing. Google Search Central
Check which URL Google chose
Open the URL Inspection tool in Search Console and inspect a duplicate URL. It shows two fields: the user-declared canonical (what your tag says) and the Google-selected canonical (what Google uses). The live test shows your tag, but only the indexed result shows Google's choice.
If the two differ, look at the usual causes Google lists:
- A CMS or plugin writes the wrong canonical or redirect.
- The server returns another site's content, or identical error pages for unrelated sites.
- Hacked pages carry injected redirects or canonicals.
- Your content is syndicated or copied, and Google picked the other copy.
- Pages that should be language versions lack hreflang.
Also check whether your canonical URL is the better page by Google's own signals: Google prefers HTTPS over HTTP, unless the HTTPS page has problems such as an invalid certificate, and it favors URLs that belong to an hreflang cluster. For the bigger picture of URL choices, see URL canonicalization.