Website Spec
← Foundations
Recommended

Canonical URL (rel=\"canonical\")

Declare the preferred URL for a page so search engines and crawlers consolidate ranking signals on one address, even when several URLs serve the same content.

What it is

The canonical link tells crawlers which URL is the authoritative version of a page when the same content is reachable through several addresses:

<link rel="canonical" href="https://example.com/articles/lang-attribute" />

It belongs in <head> and was standardised in RFC 6596. All major search engines honour it.

Why it matters

The same content often lives at multiple URLs without anyone meaning it to:

Without a canonical, crawlers may index every variant separately, splitting ranking signals and backlinks across duplicates. With a canonical, those signals consolidate on one URL. The result is a stronger ranking for the page you actually want to rank, and a cleaner index.

A canonical is a strong hint, not an absolute directive. Search engines can override it if other signals (sitemaps, redirects, internal links) point elsewhere. Make all your signals agree.

How to implement

Put a self-referencing canonical on every public HTML page. Even pages without duplicates benefit: it removes ambiguity for query-string variants and short-circuits any scraper that copies the page.

<link rel="canonical" href="https://example.com/articles/lang-attribute" />

Rules:

Cross-domain canonicals are valid when content is syndicated. If you republish an article on a partner site, the partner can canonical back to your original:

<!-- On partner.example -->
<link rel="canonical" href="https://yoursite.example/articles/the-original" />

For pages that exist in multiple languages, use hreflang in addition to canonical. Each language version is its own canonical; hreflang ties them together.

The canonical can also be sent as an HTTP header, which is useful for non-HTML resources like PDFs:

Link: <https://example.com/whitepaper.pdf>; rel="canonical"

Common mistakes

Verification

Sources