Search Engine Basics

What Is a Canonical Tag? How to Use Rel=Canonical

A canonical tag is a line of HTML that tells search engines which version of a page is the main one. This guide explains why duplicate URLs happen in the first place. It shows the tag with real examples before covering the mistakes that make Google ignore it.

Updated 26 Oct 20268 min readChecked against Google Search Central
Quick answer

A canonical tag looks like this: <link rel="canonical" href="https://example.com/page/">. It goes in the head of a page. It points to the preferred URL when the same content lives at several addresses. Google treats it as a strong hint, not a strict command.

Usman AliWritten by Usman AliGrowth and SEO specialist · 7 years in SEO
Amir ShahidReviewed by Amir ShahidSenior SEO strategist · 9+ years in SEO

The basics

What Is a Canonical URL, in Plain Words

A canonical URL is the one version of a page that search engines index when the same content exists at several addresses.

The same page can often be reached at many web addresses. A shop might show one shirt at /shirt/ while a tracking link opens the same shirt at /shirt/?ref=email. To a person, these are one page. To a search engine, they are separate URLs with the same content.

Search engines do not want to show five copies in results. Instead, they group the copies together before picking one version to index. That chosen version is called the canonical URL. The canonical tag is how you tell them which one you prefer. It is part of how search engine indexing handles duplicate content. For a wider view of crawling, indexing and ranking together, start with our guide to search engine fundamentals.

Without a canonical

Google guesses

It picks a version on its own. It might choose a messy URL with tracking codes as the one to show.

With a canonical

You guide the choice

In the tag, you name the clean URL you want in search. Google usually follows your choice, so links get credited to that one address.

See the code

Canonical Tag Examples You Can Copy

The tag always sits inside the head section of the page. Always use the full URL, including the https part.

Self-referencing canonical

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

Parameter URL points to main page

<!-- On /shirt/?color=blue&ref=email --> <link rel="canonical" href="https://example.com/shirt/">

Republished article on another site

<!-- On partner-site.com/your-article/ --> <link rel="canonical" href="https://example.com/original-article/">

Canonical for a PDF file (HTTP header)

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

Most WordPress SEO plugins add a self-referencing canonical to every page automatically. You only need to change it when a page should point somewhere else. Files like PDFs have no head section, so they use an HTTP header instead.

How Google decides

How Google Picks the Canonical URL

Your canonical tag is one vote among several. Google looks at all of them before it chooses.

SignalStrengthWhat it tells Google
301 redirectVery strongThe old URL has moved for good
rel=canonical tagStrongThis is the version you prefer
Internal linksMediumThe URL your own site links to most
Sitemap URLsWeakerThe URLs you list as important
HTTPS over HTTPWeakerSecure versions are usually preferred

When every signal agrees, Google almost always follows your choice. Trouble starts when those signals point to different addresses. If your tag says /shirt/ but your menu links to /shirt/?color=blue, Google may pick the parameter URL. Keep your internal links pointing at the same address as the tag. Your sitemap should use that address as well.

Worked example

One Product, Twelve URLs

Worked example

How filter links split a shop's rankings

This pattern shows up on almost every online shop. A store sells one pair of running shoes. Shoppers can filter by size or color, while emails add tracking codes. Soon one product page exists at a dozen addresses.

  • The problemOther sites link to three different versions. The link value is split, so no single URL ranks well.
  • The signal clashThe sitemap lists /shoes/runner/, while the menu links to /shoes/runner/?size=9.
  • The fixEvery version gets a canonical to /shoes/runner/. Menu links now use the clean URL, as does the sitemap.
  • The resultGoogle groups the copies into one cluster. Links count toward one page, so it has a better chance to rank.

Lesson: a canonical tag works best when your whole site points at the same URL.

Avoid these

Common Canonical Mistakes and Fixes

A wrong canonical can quietly remove a page from search. When a page drops out, check for these errors first.

Every page points to home

A theme bug sets the homepage as canonical on all pages. Google may then drop the rest from results.

Check after theme changes

Canonical plus noindex

One tag says index the other URL, while noindex says drop this one. That mixed signal leaves Google unsure which instruction to follow.

Pick one method

Pointing to a broken page

A canonical that leads to a 404, or to a URL that redirects somewhere else, is usually ignored. Always point to a live final page that returns 200.

Use final URLs
  • Relative URLs. Write the full address with https, not just /page/, to avoid mix-ups.
  • More than one tag. Keep one canonical per page, because two conflicting tags cancel each other out, so Google may ignore both.
  • Tag in the body. The tag only works inside the head section of the HTML.
  • Using robots.txt instead. Blocking duplicates in robots.txt stops Google from seeing the canonical at all.

Beyond filters, duplicates often come from session IDs in URLs, http versus https versions, www versus non-www hosts, print versions or syndicated copies on partner sites. A single rel canonical pointing at the preferred URL consolidates links with other ranking signals onto that one address. Google, Bing and Yahoo announced support for the tag in February 2009, while the IETF formalised it as RFC 6596 in April 2012. Because sites change constantly, run regular canonical audits with a site crawler after redesigns, migrations or plugin updates.

Pick the right tool

Canonical vs 301 Redirect vs Noindex

All three tools keep duplicates out of search, but each one works in a different way.

ToolWhat visitors seeWhat search engines doUse it when
Canonical tagBoth pages still openShow the main version, merge link equity into itCopies must stay live, like filter or tracking URLs
301 redirectSent to the new pageReplace the old URL with the new oneA page has moved for good
NoindexThe page stays openDrop the page from resultsThe page has no search value at all

Canonical tags are the right choice in these common cases:

  • Tracking codes. UTM parameters from emails or ads create copies of the same page.
  • Product variants. Filters for size or color show the same product at new URLs.
  • Protocol or www versions. Every version of your domain should point to one address, ideally with a redirect as well. That covers http versus https, plus www versus non-www.
  • Pagination. Page 2 of a list should point to itself, not to page 1, because its content is different.
  • Language versions. Each language page keeps a self-referencing canonical, while hreflang links the versions together.
  • Canonical chains. If page A points to B, while B points to C, point A straight to C instead.

Step by step

How to Check Your Canonical Tags

Two quick checks show the canonical you set. They also reveal the one Google actually chose.

01View sourceOpen the page source with Ctrl+U before searching for the word canonical.
02Inspect URLPaste the page into URL Inspection in Search Console.
03CompareCheck the user-declared canonical against the Google-selected one.
04Fix signalsIf the two differ, update your links so they match the tag. The URLs in your sitemap should match it too.

The page indexing report also lists pages marked as duplicates. Our guide to checking if a page is indexed walks through that report.

FAQ

Questions About Canonical Tags

Should every page have a canonical tag?

Yes, adding one to every page is a good habit. A self-referencing canonical on every page protects it against copies made by tracking codes or URL parameters.

Is a canonical tag the same as a redirect?

No, because the two work in different ways. A redirect sends visitors to a new address. A canonical tag leaves both pages open to visitors, while asking search engines to show only the main one.

Can a canonical point to another website?

Yes, a cross-domain canonical is common when an article is republished on another site. It tells Google the original version lives elsewhere.

Why did Google choose a different canonical?

Your other signals probably disagree with the tag. Your internal links may point to another version of the page. When your sitemap or redirects do the same, Google trusts those signals over the tag.

Do canonical tags pass link value?

Google first groups all the duplicates into one cluster. Signals such as links are then mostly credited to the chosen canonical URL.

Is a canonical tag always necessary?

No, Google can pick a canonical on its own, so small sites with clean URLs rarely run into trouble. A self-referencing tag is still cheap insurance against duplicates created by tracking codes or parameters.

Can a page have more than one canonical tag?

It should not, because Google may ignore every canonical on a page once it finds conflicting ones. Check that your theme and SEO plugin are not both adding a tag.

Wrapping up

Final Thoughts on Canonical Tags

Duplicate URLs are normal on the web. Filters and tracking codes create new copies every day. The canonical tag is your simple way to say which copy matters. It keeps your link value in one place, so the right page shows in search.

Start with a self-referencing canonical on every page. Most SEO plugins handle that for you. Then make sure your whole site agrees with it. Your internal links should all point to the same clean URL. Your sitemap should list that URL too. Check the URL Inspection tool every few weeks to see which version Google chose. If Google picked a different canonical, treat it as a hint that your signals disagree. Once you fix the clash, Google will usually follow your lead.

Scroll to Top