Course contentsShow
← Web Development
Lesson 1846 of 2,98234. Metadata and SEOFree lesson

What is a Canonical URL?

Understanding canonical URLs and why they're needed to handle duplicate content across multiple URLs.

What is a Canonical URL?

You'll learn what canonical URLs are and why they prevent duplicate content issues when the same page is accessible via multiple URLs.

The Problem: Multiple URLs, Same Content

Imagine your product page can be reached through:

  • example.com/products/blue-shirt
  • example.com/products/blue-shirt?ref=email
  • example.com/products/blue-shirt?color=blue
  • www.example.com/products/blue-shirt

All four URLs display identical content, but search engines treat them as separate pages. This splits your SEO value across multiple URLs instead of consolidating it on one authoritative version.

What is a Canonical URL?

A canonical URL is the preferred, "official" version of a page that you declare when duplicate or very similar content exists at multiple URLs. Think of it like designating one person as the spokesperson when multiple people could answer the same question—you want everyone directing attention to the same source.

You declare it using a <link> element in your document's <head>:

<link rel="canonical" href="https://example.com/products/blue-shirt">

This tells search engines: "No matter which URL variation brought you here, treat this URL as the main one."

Why Canonical URLs Matter

Without a canonical tag, search engines must guess which version to index and rank. This can:

  • Dilute your search rankings across duplicate pages
  • Waste crawl budget on redundant content
  • Confuse analytics and tracking

The canonical tag consolidates all SEO signals (backlinks, social shares, rankings) to your chosen URL, even when users access your content through tracking parameters, session IDs, or alternate domain variations.

Key Takeaway: A canonical URL is the authoritative version of a page you declare via <link rel="canonical">, ensuring search engines consolidate duplicate content signals to one preferred URL instead of splitting rankings across variations.