What is a canonical URL?
The <link rel="canonical"> tag tells search engines which version of a page is the "primary" or "original" version. When the same content is accessible through multiple URLs, the canonical tag prevents duplicate content issues.
Why does it matter?
Duplicate content problems
Without a canonical URL, search engines may see these as separate pages:
https://example.com/pagehttps://example.com/page?ref=newsletterhttps://example.com/page?utm_source=twitterhttps://www.example.com/pagehttp://example.com/page
This dilutes your SEO signals — instead of one strong page, you have five weak ones competing with each other.
How search engines handle duplicates
- Google may choose the wrong URL as canonical
- Link equity (backlinks) gets split across duplicate URLs
- Crawl budget is wasted on duplicate pages
- Rankings can drop due to content fragmentation
How to fix it
Add the canonical tag inside your <head>:
<link rel="canonical" href="https://yoursite.com/your-page" />Best practices
- Always use absolute URLs —
https://yoursite.com/page, not/page - Use HTTPS — The canonical should be the HTTPS version
- Be consistent with trailing slashes — Pick one format and stick with it
- Self-referencing canonicals — Every page should have a canonical pointing to itself
- Match with og:url — Your
og:urland canonical should typically be the same URL - Include on paginated pages — Each page of a series should have its own canonical
Common mistakes
<!-- Bad: Relative URL -->
<link rel="canonical" href="/my-page" />
<!-- Bad: HTTP instead of HTTPS -->
<link rel="canonical" href="http://example.com/page" />
<!-- Bad: Includes query params -->
<link rel="canonical" href="https://example.com/page?sort=date" />
<!-- Good -->
<link rel="canonical" href="https://example.com/page" />Relationship with og:url
Both canonical and og:url serve similar deduplication purposes, but for different audiences:
canonical→ for search engines (Google, Bing)og:url→ for social platforms (Facebook, LinkedIn)
Ideally, both should point to the same URL.