What Is a Canonical Tag? Fixing Duplicate Content the Right Way
What is a canonical tag, how do you add it and why does Google sometimes ignore it? Code examples, common mistakes and a checklist for duplicate URLs.
A canonical tag is an HTML link that tells search engines which of several URLs with the same or very similar content is the main version. It is added to the page’s <head> section as <link rel="canonical" href="…">. The short answer to “what is a canonical tag” is this: it is the most common way to gather signals spread across duplicate addresses into one canonical URL.
In this article I explain how the tag works, where and how to add it, why Google sometimes ignores it, and the mistakes I see most often. I covered the overall framework of crawling and indexing in my what is technical SEO article. The canonical tag is the duplicate-content part of that framework.
What is a canonical URL and what is it for?
A canonical URL is the address Google finds the most representative within a cluster of duplicate pages and prefers to show in search results. Google calls this selection process canonicalization.[2] The canonical tag is your contribution to that choice: you say “this is the main page in this cluster”.
Duplicate content means the same primary content can be opened from more than one URL. Google lists the common causes as regional variants, mobile and desktop versions, HTTP and HTTPS versions, sorting and filtering results on category pages, and demo sites accidentally left crawlable.[2] Google also states that some duplication within a site is normal and isn’t a violation of its spam policies.[2]
The problem isn’t a penalty; it is fragmentation. The reasons Google gives for specifying a canonical fall under four headings:[1]
- The address shown in results: Users see the clean URL instead of an address with a tracking parameter like
?gclid=…. - Consolidating signals: Links to the duplicates are gathered at a single preferred URL.
- Simpler measurement: The performance of a piece of content can be tracked through one address.
- Crawl efficiency: Googlebot spends its time on new and updated pages instead of copies of the same content.
According to Google, the canonical page is crawled more regularly, while duplicates are crawled less often to reduce the crawl load on the site.[2] Google also evaluates content and quality mainly through the canonical page.[2]
How do you add a canonical tag?
Short answer
How do you add a canonical tag?
A canonical tag is set up by adding a link rel=“canonical” element to the HTML head section of duplicate pages, pointing to the absolute address of the main page. The main page should also carry a canonical that points to its own address. For non-HTML files such as PDFs, the same information is given with an HTTP response header called Link.
- Identify the main page in the duplicate cluster.
- Take the absolute URL of the main page (with https and the preferred domain).
- Add a rel="canonical" link pointing to that address in the head section of the duplicate pages.
- Add a canonical pointing to its own address on the main page as well.
- Use the Link HTTP header for non-HTML files.
- Check the canonical Google selected with the URL Inspection tool.
The most common method is the link element inside the HTML. A simple setup, similar to Google’s example, looks like this:
<head>
<title>Green Dresses</title>
<link rel="canonical" href="https://www.example.com/dresses/green/" />
</head>
This tag has three rules. First, Google only accepts the rel="canonical" element in the <head> section of the HTML, so at least the head section must be valid HTML.[1] Second, Google recommends absolute URLs instead of relative paths (/dresses/green/). Relative paths are supported, but they can cause problems on a test site that is accidentally left crawlable.[1] Third, Google also advises adding a self-referential canonical that points to the main page’s own address.[1]
The canonical link relation is a web standard. RFC 6596 defines the canonical relation for indicating the preferred version within a set of duplicate content.[4] Google states that it supports this standard.[1]
Canonical in the HTTP header
A head section can’t be added to non-HTML files such as PDF or Word documents. For these files Google supports the Link HTTP response header and asks for absolute URLs here too.[1]
HTTP/1.1 200 OK
Link: <https://www.example.com/downloads/guide.pdf>; rel="canonical"
Google recommends choosing either the HTML element or the HTTP header and sticking with it. Using both is supported, but it raises the risk of writing different addresses in two places.[1]
Canonical with JavaScript
On sites rendered in the browser (client-side rendering), it is important that the canonical information is clear. Google’s advice is to set the canonical in the HTML source code and make sure JavaScript doesn’t change that element.[1] If you can’t set it in the source code, leave the canonical out entirely and add it only with JavaScript. Showing one address in the raw HTML and another after rendering is the worst case.
What is the difference between canonical, a 301 redirect and noindex?
Canonical, 301 redirects and noindex answer different questions: a canonical says “which page is the main one?”, a redirect says “where did this address move?”, and noindex says “keep this page out of the index”. Choosing the wrong tool can remove a page from search entirely instead of fixing the duplication.
Canonical tag
- The duplicate address stays open
- The user isn’t redirected
- Signals consolidate at the main URL
- Good fit: filters, parameters, variants
301 redirect
- The old address no longer opens
- Users and bots go to the new address
- Signals a permanent move
- Good fit: removed or moved pages
Google recommends using a permanent redirect only when deprecating a duplicate page.[1] On noindex it is even clearer: it doesn’t recommend using noindex to steer canonical selection within a site, because noindex blocks the page from Search completely.[1]
Robots.txt isn’t a canonicalization tool either. According to Google, URLs blocked in robots.txt may still be indexed without their content.[1] On top of that, Google can’t crawl a blocked page, so it can’t see the canonical tag on it. The URL removal tool shouldn’t replace a canonical either; according to Google, it hides all versions of a URL from Search.[1]
The signals Google treats as relevant in canonical selection are whether the page is served over HTTP or HTTPS, redirects, the URL’s presence in a sitemap, and rel canonical annotations.[2] The sitemap method is easy on large sites, but according to Google it is a weaker signal than canonical mapping.[1]
Why does Google ignore the canonical tag?
Google doesn’t always follow the canonical tag, because a canonical preference is a hint, not a strict rule.[2] Even when you explicitly designate a canonical, Google may choose a different page because of content quality or technical signals.[3] In practice the most frequent reason is that different signals point to different addresses.
Google’s best-practice list names examples of this conflict directly:[1]
- Listing one address in the sitemap and another in the canonical tag.
- Linking internally to duplicate addresses instead of the canonical URL.
- Specifying a URL fragment (such as
#section) as canonical. - Pointing the canonical to a page in a different language when using hreflang.
Google also doesn’t use canonical tags that carry hreflang, lang, media or type attributes for canonicalization.[1] Alternate versions like these need rel="alternate".
How do I see the canonical page Google chose?
The Google-selected canonical is shown in the URL Inspection tool in Search Console. Google recommends using this tool as the first troubleshooting step and considering whether its own choice makes more sense for users.[3] The report shows “User-declared canonical” and “Google-selected canonical” side by side. If they differ, there is a signal conflict. I explained how to use the report in general in my how to use Google Search Console guide.
After a fix you need patience. According to Google, even after content is fixed, pages may stay in a duplicate cluster for up to two weeks.[3] If the new content is clearly different from the other pages in the cluster, they split out faster.[3] This can also appear in Search Console as the “Duplicate, Google chose different canonical than user” warning. I covered that warning together with other indexing statuses in my crawled - currently not indexed article.
What are the most common canonical tag mistakes?
Most canonical tag mistakes come from the tag being generated incorrectly at template level. A single CMS setting or plugin can break the canonicals of thousands of pages at once. Google also notes that some content management systems and plugins can point canonicals to undesired URLs.[3]
These are the mistakes I run into most often in audits:
- Every page pointing to the home page: A canonical hard-coded into the template makes every page look like a copy of the home page.
- Canonical chain: A points to B, and B points to C. Every duplicate should point directly to the final main address.
- Unreachable target: The canonical points to an address that returns 404, a redirect or noindex.
- More than one canonical: The theme and an SEO plugin print two different tags on the same page.
- Protocol and domain mismatch: Pointing to the HTTP address on an HTTPS site, or to the www address on a non-www site. Google uses HTTPS as a signal in canonical selection.[2]
- Pointing paginated pages to the first page: Pages 2 and 3 of a category list contain different products; tying them all to page 1 can weaken the discovery of those products.
Turkish sites also need care with URL spelling. If the same page opens at /urunler/kisa-kollu/, /urunler/Kisa-Kollu/ and without the trailing slash, there are three separate URLs. On sites that use slugs with Turkish characters (/ürünler/), generating both the percent-encoded and transliterated versions creates similar duplicates. The cleanest solution is to pick one spelling, redirect the others, and write the canonical in that same form.
There is an attack scenario too. According to Google, some attacks insert a canonical pointing to another domain into the page’s head section, and Google may then choose the malicious address as canonical.[3] If you see an unexpected domain, treat it as a security incident, not a technical bug.
How do you use canonicals on ecommerce and multilingual sites?
On ecommerce sites, canonicals are used to gather duplicates created by filter, sort and variant addresses at the main category or product page. Google lists sorting and filtering results on category pages among the typical causes of duplicate content.[2] Which filter becomes a separate page and which one is a duplicate is a site architecture decision. I covered that distinction in detail in my ecommerce site architecture and category page SEO articles.
The rule is different on multilingual sites. Google states that pages are considered duplicates only if the primary content is in the same language. Pages where only the menu and footer are translated but the body stays the same are duplicates.[2] Genuinely translated TR and EN pages aren’t duplicates; each should point to its own address as canonical, and the relationship between them should be set with hreflang. For regional variants in the same language (such as English pages for the US and the UK), Google recommends using canonicals and hreflang together.[2] In multi-market sectors like health tourism, this distinction is decisive. I covered the market side of the topic in my health tourism SEO article.
Syndication is a special case. Google doesn’t recommend canonicals for avoiding duplication from an article published on partner sites. The reason is that these pages are often very different from each other. The most effective solution Google suggests is for the partner to block indexing of the copy.[3]
How do I audit a canonical setup?
A canonical audit is about checking the consistency of signals more than the presence of the tag. I run the audit in this order:
- Crawl the site
Pull every URL with a crawler tool; collect each page’s canonical address, status code and indexability in one table.
- Verify canonical targets
Check that every canonical target returns 200, carries no noindex and doesn’t redirect elsewhere.
- Compare signals
Compare whether the sitemap URLs, internal links and canonical tags all show the same address format.
- Look at the rendered HTML
Check that the canonical is the same in the raw HTML and in the HTML after JavaScript runs.
- Check Google’s choice
Open sample URLs from important templates in the URL Inspection tool; compare the user-declared and Google-selected canonicals.
Before going live, you can tick off this list template by template:
These checks are also a fixed part of the technical audits I run as part of my SEO services. Canonical problems are usually solved in a template or a plugin, not URL by URL.
Conclusion
A canonical tag is a hint you give Google to consolidate duplicate URLs at one main address. Its effect depends on how consistent it is with the other signals. Add the tag to the head section with an absolute URL, give the main page a self-referential canonical, and align the sitemap and internal links to the same address. Then check Google’s choice with the URL Inspection tool. As a next step, pick the template on your site that produces the most duplicates, usually the filtered category page, and audit it with the checklist above.
Key terms
- Self-referential canonical
- Self-referential canonical is a rel="canonical" tag in which a page points to its own address. It is also called a self-referencing canonical. Google recommends it, because copies opened through parameterised or tracking-tagged URLs are then tied to the same main URL.
- Duplicate content
- Duplicate content is the same or very similar primary content being accessible from more than one URL. According to Google, some duplication within a site is normal and isn't treated as spam; the real problem is that signals get split and the wrong address may appear in results.
- Google-selected canonical
- Google-selected canonical is the address Google finds the most complete and useful within a cluster of duplicate pages and uses as the basis for evaluation and ranking. It can differ from the site owner's canonical preference and is shown in the URL Inspection tool in Search Console.
- Canonical chain
- Canonical chain is a faulty setup in which the canonical address is defined over several steps, for example page A points to B and B points to C. It sends conflicting signals to search engines. The fix is for every duplicate's canonical to point directly to the final main address.
Frequently asked questions
Should every page have a canonical tag?
It isn't mandatory, but it is recommended. Google advises adding a self-referential canonical that points to the canonical page's own address. This tag makes it clear from the start which URL is the main one when the page is reached through parameterised or duplicate addresses.
What is the difference between a canonical tag and a 301 redirect?
A 301 redirect moves users and bots from the old address to the new one; the old address no longer opens. A canonical tag keeps both addresses open and only tells the search engine which one is the main version. Use a redirect when a page is removed for good, and a canonical when both addresses serve users.
Why does Google ignore the canonical tag?
According to Google, a canonical is a hint, not a strict rule. If the sitemap, internal links and redirects point to a different address, or the target page is clearly different in content, Google may choose another page as canonical. The URL Inspection tool shows Google's choice.
Can a canonical tag be used together with noindex?
It isn't recommended. Noindex asks for the page to be removed from the index entirely, while a canonical asks for signals to be consolidated at another address. Google doesn't recommend using noindex to steer canonical selection within a site; a canonical alone is enough on the duplicate page.
Can a canonical tag point to another domain?
Yes, rel canonical can point to a page on a different domain. Still, Google doesn't recommend canonicals for avoiding duplication from syndicated articles, because those pages are often very different. The most effective option is for the partner to block indexing of the copy.
Sources
The full topic: Technical SEO guide ↗