Canonical Tags: Fix Duplicate Content
The Canonical Tag (rel="canonical") is your primary defense against duplicate content. It
tells search engines which version of a URL is the "master" or primary copy, ensuring your ranking
signals aren't diluted across multiple identical pages.
1. What is a Canonical Tag?
A canonical tag is an HTML snippet located in the <head> of a webpage. It specifies
the "canonical URL"—the preferred URL that search engines should index and rank.
If you have the exact same (or highly similar) content available on multiple URLs, search engines get confused. They don't know which version to index, which one to rank, or how to consolidate the link equity (backlinks) pointing to these pages. The canonical tag solves this.
2. Why are Canonical Tags Important?
Duplicate content happens more often than you think. E-commerce platforms, CMS systems, and tracking parameters frequently generate multiple URLs for the same page:
- Tracking parameters:
example.com/shoes?utm_source=email - Sorting/Filtering:
example.com/shoes?sort=price_asc - Session IDs:
example.com/shoes?sessionid=123 - WWW vs. Non-WWW:
www.example.comvsexample.com - HTTP vs. HTTPS:
http://example.comvshttps://example.com
Without a canonical tag, Google sees all of these as separate pages. The canonical tag consolidates all ranking signals and link equity to your single, preferred URL.
Warning: A canonical tag is a hint, not a strict directive. If your canonical tag points to a page with completely different content, or if you make implementation errors, Google may choose to ignore your hint and select a canonical URL itself.
3. HTML Code Example
The standard way to implement a canonical tag is inside the <head> section of your
HTML document.
If a user accesses the URL https://www.rankosaur.com/features/?sort=recent, the page's HTML
should contain the following tag pointing back to the clean, primary URL:
<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="https://www.rankosaur.com/features/" />
</head>
<body>
<!-- Page Content -->
</body>
</html>
4. Canonical in the HTTP Header
If you need to canonicalize non-HTML files (like PDF documents or images) where you cannot insert an HTML
<head> section, you must send the canonical link via the HTTP response header.
Example HTTP Header Response:
HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <https://www.rankosaur.com/seo-guide.html>; rel="canonical"
5. Best Practices
- Use Absolute URLs: Always use absolute URLs
(
https://www.example.com/page/) instead of relative URLs (/page/). Relative URLs can easily break if the site architecture is mishandled. - Self-Referencing Canonicals: It is highly recommended that every page has a canonical tag pointing to itself (if it is the master version). This prevents scraper sites or URL parameters from accidentally creating duplicate content.
- Cross-Domain Canonicals: You can use canonical tags across different domains. If you publish an article on your blog and syndicate it to Medium or another publisher, the syndicated article can
carry a canonical tag pointing back to your original post. For syndicated content, however, Google now primarily
recommends
noindexon the secondary publication, because cross-domain canonicals are frequently ignored there. - Use Lowercase URLs: Since search engines treat uppercase and lowercase letters as different URLs, always enforce lowercase URLs in your canonical tags.
6. Common Mistakes to Avoid
- Mixing Canonical with Noindex: Never put a
noindextag on a page while simultaneously having a canonical tag pointing to another page. These are conflicting signals. (Noindex says "drop this out of the index", Canonical says "pass the equity of this page to another page"). Use one or the other. - Canonicalizing Paginated Pages to Page 1: Never point
/blog?page=2to/blog. This will cause Google to stop crawling your paginated series, meaning your older articles will drop out of the index. Paginated pages should have a self-referencing canonical tag. - Multiple Canonical Tags: If a page has two canonical tags pointing to different URLs (often caused by having multiple SEO plugins installed), Google will simply ignore both tags.
- Canonicalizing to a 404 or Redirect: Ensure your canonical URL returns a
200 OKstatus code. Pointing a canonical tag to a dead page or a redirect chain wastes crawl budget and confuses search engines.
Pro Tip: Using Rank-O-Saur, you can instantly see the active Canonical Tag of any page you visit and verify if it matches the current URL (self-referencing) or points elsewhere.
7. Quick reference: which signal to use
Canonicalisation is one of four related tools, and picking the wrong one is the usual cause of pages disappearing or duplicates persisting. This table maps the situation to the correct signal.
| Situation | Correct signal | Why |
|---|---|---|
| Same content reachable under parameters | Canonical tag | The variant stays usable while the ranking signals consolidate on the clean URL. |
| Page has permanently moved | 301 redirect | Users and crawlers should no longer reach the old URL at all. |
| Page must stay reachable but out of the index | noindex | A canonical is only a hint and does not reliably remove a page from the index. |
| Same content for another language or region | hreflang plus self-canonical | Language versions are not duplicates; canonicalising them together deletes one from the index. |
8. Frequently asked questions
Does a canonical tag guarantee that the chosen URL gets indexed?
No. Google treats the canonical tag as a strong hint, not a directive. If other signals — internal links, the XML sitemap, redirects or hreflang — point somewhere else, Google may pick a different canonical. Use the URL Inspection tool in Search Console to see which URL Google actually selected.
Should a page have a canonical tag pointing to itself?
Yes. A self-referencing canonical on every indexable page is best practice. It removes ambiguity as soon as tracking parameters, session IDs or sort orders get appended to the URL, because every variant then names the clean URL as the original.
What is the difference between a canonical tag and a 301 redirect?
A 301 removes the duplicate for both users and crawlers — the old URL no longer resolves. A canonical keeps every variant reachable but consolidates the ranking signals on one URL. Use a redirect when the old URL should disappear, and a canonical when users still need the variant.
Do canonical tags work across different domains?
Yes. Cross-domain canonicals are valid and are the intended solution for syndicated content. However, Google weighs them even more cautiously than same-domain canonicals, so make sure the syndicated copy is genuinely identical to the original.