Back to Glossary
SEO

Canonical URL

A canonical URL is the version a search engine selects as the representative (master) page among several URLs that serve the same or near-identical content. Site owners can signal a preference with a rel="canonical" tag, an HTTP header, a sitemap, or a 301 redirect, but Google makes the final choice by weighing multiple signals.

  • A canonical URL is the page a search engine picks to represent a cluster of duplicate or near-duplicate URLs; Google calls this selection process canonicalization.
  • Designating a canonical consolidates scattered link and ranking signals onto one URL and cuts wasted crawling of duplicate pages.
  • You can express a preference via a rel="canonical" tag, an HTTP header, a sitemap, or a 301 redirect, but these are signals, not directives, so Google may still choose a different URL.
  • By Google's own ranking of signal strength, a redirect outweighs a rel="canonical" annotation, which outweighs sitemap inclusion, and canonicals should use an absolute URL rather than a relative path.
  • Combining a canonical and a noindex on the same page sends conflicting signals; to remove a page entirely, use a 301 redirect, not a canonical.

What Is a Canonical URL

A canonical URL is the URL a search engine selects as the most representative version among several URLs that serve identical or near-identical content. Google defines it as "the URL of the page that Google chose as the most representative from a group of duplicate pages," and calls the process of choosing that representative page canonicalization.

When a single piece of content is reachable through multiple URLs (for example, http vs. https, with or without www, tracking parameters, or sort/filter variants), both user experience and performance measurement suffer, and search engines end up crawling the same content repeatedly. Consolidating to one representative URL pulls the signals scattered across the individual URLs (such as links) onto a single preferred URL and reduces the crawl burden created by duplicates.

How to Specify a Canonical

Google supports several methods, and they carry different signal strengths. Per Google's official documentation, a redirect is the strongest signal, followed by a rel="canonical" annotation, while inclusion in a sitemap is a weak signal. None of the methods is mandatory, but when duplicates exist it is safer to state a preference explicitly.

1. rel="canonical" link element (HTML head)

The most common method specifies the representative URL as an absolute path inside the page's <head>.

<head>
  <title>Explore the world of dresses</title>
  <link rel="canonical" href="https://example.com/dresses/green-dresses" />
</head>

Google recommends a full absolute URL rather than a relative path. Also, if a page declares more than one rel="canonical", Google ignores all of them, so keep exactly one per page. The representative page itself should carry a self-referencing canonical that points to its own URL.

2. rel="canonical" HTTP header

For non-HTML documents such as PDFs, where you cannot place a tag in the <head>, specify the representative URL in the HTTP response header (RFC 5988 format).

HTTP/1.1 200 OK
Content-Type: application/pdf
Link: <https://www.example.com/downloads/white-paper.pdf>; rel="canonical"

3. Sitemap

This approach picks each page's representative URL and submits it in a sitemap. Every URL included in a sitemap is "suggested" as a canonical candidate, but this is a weaker signal than the two methods above.

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/dresses/green-dresses</loc>
  </url>
</urlset>

4. 301 redirect

Use this when you want to eliminate the duplicate page itself. It acts as the strongest signal that the redirect's target URL should be the canonical. If you have no need to keep the variant URL accessible, a redirect is more decisive than a canonical tag.

Canonical vs. noindex vs. 301 Redirect

All three deal with duplicate or unnecessary URLs, but their purpose and outcome differ. Combining them incorrectly produces conflicting signals.

MethodMeaningAccess to variant URLLink signal consolidationWhen to use
Canonical (rel=canonical)A signal (hint) expressing a preference for the representative URLRemains accessibleConsolidated onto the representative URLKeep all near-identical variants live but designate one as representative
301 redirectPermanent move, forced relocationNot accessible (sent to the representative)Consolidated onto the representative URLRetire duplicate or old URLs and merge them into one
noindexA directive to exclude the page from the indexAccessibleNot consolidated (excluded from the index)Pages you do not want to surface in search

Ahrefs advises against using a canonical and a noindex together on the same page. The signals contradict each other, and Google generally interprets the canonical tag with priority over noindex. Likewise, if the canonical target returns a 4XX or 5XX status or is blocked by robots.txt, link signals will not be consolidated.

Practical Checklist

  • Use an absolute URL for the representative page (the full path, including https).
  • Declare only one rel="canonical" per page; if there is more than one, all are ignored.
  • Place rel="canonical" only inside the <head>; it is ignored if it appears in the <body>.
  • Give the representative page a self-referencing canonical.
  • Do not apply a canonical and a noindex to the same page at once.
  • The canonical target must be a healthy page that returns 200 (avoid redirects, 4XX, and 5XX).
  • Do not canonicalize paginated pages to the root (Google advises against it).
  • Do not use multiple canonicalization techniques to point the same page at different representative URLs.

Sources