Canonical Tags: Resolving Duplicate Content & Choosing the Canonical URL
When the same content is reachable through multiple URLs, the search engine has to "guess" which version to index and rank—guess wrong, and link equity gets fragmented and rankings suffer. rel=canonical (the canonical tag) is how you tell the search engine "this is the master version." This article explains where duplicate content comes from, how canonical works, how to use it correctly, and how it divides responsibilities with 301 redirects, noindex, and hreflang.
What Is Duplicate Content#
Duplicate content means multiple URLs serve identical or highly similar content. Most of it isn't plagiarism—it's unintentionally produced by the site's technical structure. Common sources:
| Source | Example |
|---|---|
| Protocol / Host variants | http:// vs https://, www vs non-www |
| Tracking parameters | /page vs /page?utm_source=weibo |
| Sort / Filter parameters | /shoes vs /shoes?sort=price |
| Case / Trailing slash | /Page, /page/ vs /page |
| Session IDs | /page?sid=abc123 |
| Print / AMP versions | /article vs /article/print |
| Multiple homepage entries | / vs /index.html |
What Is canonical#
rel=canonical is a link tag placed in a page's <head> that declares "which URL is the canonical version of this page." When multiple URLs have identical content, they all point their canonical at the same canonical URL, and the search engine consolidates indexing and ranking signals onto that canonical URL.
<head>
<link rel="canonical" href="https://example.com/page.html">
</head>
Self-Referencing canonical#
The most fundamental and important usage: let every page's canonical point to itself. This is called a self-referencing canonical.
<!-- Page URL is https://example.com/page.html -->
<link rel="canonical" href="https://example.com/page.html">
Its value: when someone visits with a parameter like ?utm_source=… or through a case variant, the canonical inside those variant pages still points to the clean canonical URL, automatically consolidating accidentally produced duplicates to one place. For content sites, one self-referencing canonical per page is near-zero-cost insurance.
Usage Rules#
canonical looks simple, but there are several rules you must follow—violating any one can make it ineffective or backfire:
- Use absolute URLs: Write the full
https://example.com/page.html, not relative paths. - Point to an accessible, 200-returning page: The canonical target must not be a 404, a redirect, or a noindexed page.
- Only one canonical per page: When multiple rel=canonical appear, Google ignores all of them.
- Place it in
<head>: A canonical placed in<body>is invalid. - Normalize protocol and domain: Use HTTPS, unify www/non-www, consistent with the site-wide canonicalization strategy.
- Content must actually be identical or highly similar: Don't canonical together pages with different content.
Beyond the HTML tag, canonical can also be declared via an HTTP response header (especially useful for non-HTML files like PDFs):
Link: <https://example.com/whitepaper.pdf>; rel="canonical"
Common Use Cases#
Tracking Parameter URLs
Links carrying marketing parameters like utm have the same content as the original page; their canonical should point to the parameter-free version.
<link rel="canonical" href="https://example.com/page">
E-commerce Filter / Sort Pages
Different sort and filter combinations generate many near-duplicate pages; usually point the canonical at the parameter-free main category page (unless a specific filter combination has its own search demand and value—in that case it should self-reference).
Pagination
Paginated lists (page 2, page 3…) should have each page's canonical point to itself, not all point to page 1—because each page has different content. Canonicalizing pagination to page 1 is a common mistake that causes subsequent pages' content to go unindexed.
Content Syndication (Cross-Domain)
When your article is licensed for republication on other sites, the republisher can point their canonical at your original article URL, letting the original gain index attribution. This is cross-domain canonical.
canonical vs Other Tools#
canonical, 301, noindex, and robots.txt are often confused. They solve different problems—choosing the wrong tool causes trouble.
| Tool | Function | Page Accessible? | Best For |
|---|---|---|---|
| canonical | Declares canonical version, consolidates index signals | All accessible | Multiple URLs need to be kept, but only one should be indexed |
| 301 redirect | Permanent redirect, original URL no longer accessible | Only the target accessible | Old URL no longer needed for users |
| noindex | Prevents page from entering the index | Accessible | Page should be viewable by users but kept out of search results |
| robots.txt | Blocks crawling | Accessible (just not crawled) | Save crawl budget, don't crawl low-value paths |
noindex and a canonical pointing elsewhere to the same page—these two signals contradict (one says "don't index me," the other says "give the signals to that page"), and Google can't decide. Also don't point canonical at a page blocked by robots.txt—the crawler can't read the target and can't confirm the canonical relationship. The difference between robots / noindex is detailed in Crawling & Indexing Fundamentals.canonical with hreflang#
Multilingual sites must be especially careful: each language version's canonical should point to itself, not to another language. hreflang tells Google these are different language versions of the same content; canonical handles deduplication within each language.
<!-- Chinese page /zh/about.html -->
<link rel="canonical" href="https://example.com/zh/about.html">
<link rel="alternate" hreflang="zh" href="https://example.com/zh/about.html">
<link rel="alternate" hreflang="en" href="https://example.com/en/about.html">
A common mistake is pointing the Chinese page's canonical at the English page—this makes Google think the Chinese page shouldn't be indexed independently, and the entire language version may disappear from results. For full hreflang configuration, see Internationalization & hreflang.
Common Mistakes#
| Mistake | Consequence | Fix |
|---|---|---|
| canonical points to a 404 / redirect / noindex page | Signals fail, Google picks its own | Point to an accessible 200 canonical page |
| All pagination canonicals point to page 1 | Subsequent pages go unindexed | Self-reference each page |
| Whole-site canonical points to homepage | Almost nothing but the homepage gets indexed | Each page points to itself or the correct canonical |
| Multiple canonicals on one page | Google ignores all | Keep only one |
| Using relative URLs | May be parsed incorrectly | Use full absolute URLs |
| canonical placed in body | Invalid | Put it in head |
| HTTP/HTTPS, www inconsistency | Signals contradict | Unify with site-wide canonicalization strategy |
How to Verify#
After setting canonical, use the URL Inspection tool in Google Search Console to confirm. Focus on two fields:
- User-declared canonical: The canonical you wrote in the page.
- Google-selected canonical: The canonical version Google actually uses.
If they match, Google accepted your declaration. If not, Google combined other signals and chose a different URL—usually meaning your canonical contradicts signals like internal links, sitemap, or redirects, and you need to investigate and unify. That troubleshooting workflow is detailed in the GSC section of Crawling & Indexing Fundamentals.
This Site's canonical Strategy#
Every MagicSEO page has a self-referencing canonical pointing to itself. Take this article as an example:
<link rel="canonical"
href="https://magic-seo.com/articles/en/technical-seo/canonical.html">
<link rel="alternate" hreflang="zh-Hans"
href="https://magic-seo.com/articles/zh/technical-seo/canonical.html">
<link rel="alternate" hreflang="en"
href="https://magic-seo.com/articles/en/technical-seo/canonical.html">
<link rel="alternate" hreflang="x-default"
href="https://magic-seo.com/articles/zh/technical-seo/canonical.html">
<head> (you can verify it directly by viewing this page's source). The canonical always points to the page's own language version, while hreflang declares the other language versions. This configuration means the site structurally cannot produce duplicate-content signals.canonical Checklist#
- Every indexable page has a self-referencing canonical
- canonical uses a full absolute URL
- canonical target returns 200, not noindexed or blocked
- Only one canonical per page, and it's in head
- Each pagination page canonicalizes to itself, not page 1
- Parameter URLs canonical to the parameter-free version
- Multilingual pages canonical to their own language version
- No conflict with noindex / robots blocking
- Protocol, www, trailing slash consistent with site-wide canonicalization
- Use GSC URL Inspection to confirm Google adopted the declared canonical
Frequently Asked Questions#
Is the canonical tag a directive?
No. rel=canonical is a strong hint to Google, not a directive. Google combines multiple signals—the canonical tag, internal links, sitemap, redirects—and selects whichever canonical URL it considers most appropriate. If your canonical setting contradicts other signals, Google may ignore your declared canonical.
What's the difference between canonical and a 301 redirect?
A 301 redirect actually sends users and crawlers to the target URL, and the original URL is no longer accessible; canonical keeps all URLs accessible and just tells the search engine which is the canonical version for indexing. If a duplicate URL doesn't need to be user-accessible, prefer 301; if multiple URLs all need to be kept (such as links with tracking parameters, or print versions), use canonical.
Does every page need a canonical?
It's recommended that every indexable page add a self-referencing canonical pointing to itself. This prevents accidental duplicates like parameter URLs and case variants from diluting signals, and makes the canonical intent explicit. For small sites with no duplication risk it isn't mandatory, but as a best practice, a self-referencing canonical has almost no downside.
Can canonical point to another website?
Yes—this is called cross-domain canonical, commonly used for content syndication (the same article licensed for publication on multiple sites). The syndicating site can point its canonical at the original publishing site, letting the original article gain index authority. But use it cautiously—pointing at an external domain means you voluntarily give up index attribution for that page.