Canonical URLs: Prevent Duplicate Content
What Is a Canonical URL?
A canonical URL tells search engines which version of a page is the "main" one. This prevents duplicate content issues when the same content is accessible at multiple URLs.
When You Need Canonical Tags
- **www vs non-www** — example.com and www.example.com
- **HTTP vs HTTPS** — http:// and https:// versions
- **Trailing slash** — /page and /page/
- **Query parameters** — /products and /products?sort=price
- **Syndicated content** — Content republished on other sites
How to Add
<head>
<link rel="canonical" href="https://yoursite.com/page">
</head>
Common Mistakes
1. **Missing canonical** — Every page should have one, pointing to itself
2. **Canonical to a 404 page** — Don't point to pages that don't exist
3. **Canonical doesn't match og:url** — These should be the same URL
4. **HTTP canonical on HTTPS page** — Always use HTTPS in canonical
5. **Relative URL** — Always use absolute URL with protocol
Self-Referencing Canonicals
Even if a page has no duplicates, add a self-referencing canonical:
<!-- On https://yoursite.com/about -->
<link rel="canonical" href="https://yoursite.com/about">
This is a best practice recommended by Google.
Check your canonicals with [SEO Snapshot](/) — we verify canonical exists, check for protocol mismatches, and compare with og:url.
Check your site's SEO score for free
Analyze your site