Overview

A canonical URL is the preferred address for content that is reachable at several URLs, such as with and without a trailing slash, with tracking parameters, or syndicated elsewhere. Search engines treat the declaration as a strong signal, not a directive, and may pick a different URL.

Declare it with <link rel="canonical" href="https://example.com/page"> in the <head>, or with a Link HTTP header for non-HTML files such as PDFs. Set an absolute, self-referencing canonical on every indexable page, and point it at a URL that returns 200 and is indexable. Include only canonical URLs in the sitemap and in internal links; Google treats the sitemap as the weakest canonical signal.

Do not use robots.txt for canonicalization: a blocked URL cannot be crawled, so its canonical tag is never seen, and the URL can still be indexed without content. When a duplicate should not exist at all, use a 301 redirect, which is stronger than rel="canonical". A canonical consolidates indexing signals but does not stop crawlers from fetching the duplicates (crawl-budget).

Example

/products/widget, /products/widget?ref=email, and /products/widget?utm_source=ads all carry <link rel="canonical" href="https://example.com/products/widget">, so ranking signals consolidate on the clean URL.