What Is a Canonical URL and How to Set One

A canonical URL tells search engines which version of a page is the “real” one when the same content can be reached at more than one address. Setting it correctly stops duplicate URLs from splitting your rankings.

What a canonical URL means

Most pages can be opened at several addresses without you noticing: with and without www, over http and https, with a trailing slash or without, with tracking parameters like ?utm_source=newsletter attached, or in upper and lower case. To a visitor these are all the same page. To a search engine they are different URLs that happen to show the same content.

The canonical URL is the single address you want search engines to treat as the original. You declare it with a link tag in the page head:

<link rel="canonical" href="https://example.com/blog/my-post">

Every duplicate version of the page should carry the same tag pointing at that one preferred address.

Why it matters for SEO and GEO

When the same content lives at five URLs, links and signals get spread across all five instead of concentrating on one. Search engines may pick a version you did not intend, index the one with tracking parameters, or waste crawl budget re-crawling copies. A canonical tag consolidates those signals and makes the preferred URL the one that shows up in results.

AI answer engines face the same problem. If a model sees the same passage at several addresses, it has to guess which one to cite. A clear canonical gives it a single, stable URL to attribute, which is exactly what you want for citations.

How to choose the canonical version

Pick one convention and apply it everywhere. The usual choices are:

  • HTTPS, not HTTP.
  • One hostname: either www.example.com or example.com, never both.
  • Lowercase paths, since many servers treat /Blog and /blog as different URLs.
  • A trailing-slash rule: either always or never on non-homepage URLs.
  • No tracking parameters such as utm_*, fbclid or gclid. Keep parameters only when they change the content, like a product variant.

How to set a canonical tag

  1. Decide the preferred URL for the page using the rules above.
  2. Add <link rel="canonical" href="..."> inside the <head> with the full absolute URL, including https:// and the hostname.
  3. Use a self-referencing canonical on the preferred page itself. It is best practice even when you have no known duplicates.
  4. Make every duplicate version point to the same preferred URL, not to itself.
  5. Where possible, also redirect the non-preferred versions (http, www, trailing slash) to the canonical with a 301, so visitors and crawlers land on the right address in one hop.

Most CMS platforms add a self-referencing canonical automatically, but it is worth checking the page source, because themes and plugins sometimes emit the wrong hostname or a relative path.

Common canonical mistakes

  • Relative URLs like href="/blog/my-post". Use the full absolute URL.
  • Pointing every page to the homepage. Each page needs its own canonical.
  • Mixing conventions, such as a canonical with a trailing slash on one page and without on the next.
  • Canonical and redirect disagreeing. If page A canonicalises to B but B redirects to A, search engines will ignore both.
  • Canonicalising paginated or filtered pages to page one when the content is genuinely different.
  • Conflicting with hreflang. Each language version should usually be its own canonical.

How to check your canonical

View the page source and search for rel="canonical". Confirm it is absolute, uses HTTPS and your preferred hostname, and matches the URL you actually want indexed. To build a clean tag quickly, paste any URL into RankForge’s Canonical URL Generator: it forces HTTPS, lowercases the path, strips tracking parameters, applies your trailing-slash rule and outputs a ready-to-paste tag.

Quick fix checklist

  1. Choose HTTPS, one hostname, lowercase paths and a trailing-slash rule.
  2. Add an absolute self-referencing canonical to every indexable page.
  3. Point all duplicate versions at that one URL.
  4. Redirect http, www and trailing-slash variants with a 301.
  5. Re-check the source after any theme or plugin change.

A correct canonical is one of the cheapest technical fixes in SEO: one line in the head, and every signal your page earns lands in the same place.

Frequently asked questions

Can a page have more than one canonical tag?

No — use exactly one. If a page carries two canonical tags, search engines pick one themselves and may ignore both, so check your theme, plugins and templates for duplicates after every change.

Should the canonical point to the page itself?

Yes. Every indexable page should carry a self-referencing canonical: an absolute URL pointing at its own preferred address, even when no duplicate versions exist. It confirms to search engines that this URL is the one to index.

Does a canonical tag replace a redirect?

No. A canonical is a hint, while a 301 redirect is a firm instruction. Use a redirect when a duplicate URL should never be visited, and a canonical when both versions need to stay live — for example, a product page reached through several category paths.

Related guides