SEO

Canonical Tags Explained: What rel=canonical Does and How to Get It Right

What a canonical tag does, why Google treats it as a hint, how WordPress sets it, and how to fix parameter, pagination, www and Search Console issues.

Canonical Tags Explained: What rel=canonical Does and How to Get It Right
On this page
  1. What a canonical tag looks like
  2. A hint, not a directive
  3. Self-referencing canonicals
  4. How WordPress and SEO plugins set canonicals
  5. Parameters, tracking codes and filters
  6. Pagination: don't canonicalise to page 1
  7. Cross-domain canonicals
  8. HTTP vs HTTPS, www vs non-www and trailing slashes
  9. Canonical vs redirect vs noindex
  10. How to check canonicals in Search Console
  11. Common canonical mistakes
  12. Quick check: which canonical does Google use?
  13. When to get help
  14. FAQs
Key takeaways
  • A canonical tag tells Google which of several near-identical URLs you prefer, but it is a strong hint rather than an order, so redirects, internal links and your sitemap must agree with it.
  • Most pages should have a self-referencing canonical, which WordPress and SEO plugins add automatically; paginated pages, language versions and genuinely different filter pages should point to themselves.
  • Check "Duplicate, Google chose different canonical than user" in Search Console and fix common mistakes such as canonicals pointing to an old domain, the homepage, a redirected URL or page 1.

A canonical tag is a line of code in a page's head that tells search engines which URL is the main version of that content. When the same page can be reached at several addresses, the canonical says "index and rank this one", so links and other signals are consolidated on a single URL instead of being split between duplicates. Google treats it as a strong hint, not a command, which is why canonicals only work well when the rest of your site agrees with them.

Below: how canonicals work, how WordPress sets them, and how to fix the problems that show up in Google Search Console.

What a canonical tag looks like

A canonical is a link element placed in the <head> section of a page:

<link rel="canonical" href="https://www.example.in/services/seo/" />
  • Use the full, absolute URL, including https and the right www or non-www version. Relative URLs are allowed, but they are easy to get wrong.
  • One canonical per page. If a theme and a plugin both output one and they disagree, Google may ignore both.
  • It must be in the head. A canonical that ends up in the body of the page is ignored.
  • The target should be a live, indexable page that returns a normal 200 status: not a redirect, a 404 or a page marked noindex.

For files that have no HTML head, such as PDF brochures, the same instruction can be sent as a rel="canonical" HTTP header. A developer sets that at server level.

A hint, not a directive

Google's documentation describes the canonical tag as a strong signal, and says Google may choose a different URL if other signals point elsewhere. When it finds a group of duplicate pages, it weighs several clues together:

  • Redirects, a very strong signal
  • Canonical tags on the duplicates
  • Internal links: which version your menus, buttons and articles link to
  • XML sitemaps: which URLs you list
  • HTTPS: Google generally prefers the secure version
  • The content itself: if two pages aren't really duplicates, Google may ignore the canonical altogether

That last point matters. A canonical is meant for pages that are the same or nearly the same. Pointing a page about one product at a page about a different product doesn't merge them; Google is likely to ignore the instruction.

Self-referencing canonicals

A self-referencing canonical is a page pointing to its own clean URL. It sounds pointless, but it's the recommended default. If someone links to your page with a tracking code attached, or a plugin adds a parameter, the self-referencing canonical on that version still points back to the clean address. Every page on this website includes one. Most pages should canonicalise to themselves; only true duplicates should point somewhere else.

How WordPress and SEO plugins set canonicals

WordPress itself has added a canonical tag to single posts and pages for many years. SEO plugins such as Yoast SEO, Rank Math and All in One SEO take over that output and extend it to the homepage, categories and other archives. They also let you set a custom canonical for an individual page, usually in an Advanced section of the plugin's panel below the editor. If you're choosing a plugin, see Yoast SEO vs Rank Math vs All in One SEO.

  • Leave the custom canonical field empty unless you have a specific reason. An empty field means "use this page's own URL", which is what you want most of the time.
  • Run only one SEO plugin. Two active SEO plugins, or an SEO plugin plus a theme that adds its own SEO tags, can produce duplicate canonicals.
  • Canonicals are built from your Site Address in Settings > General. If that is wrong after a migration, every canonical on the site is wrong too.
  • WooCommerce product URLs don't include the category by default, so a product in several categories still has one URL. If your permalink settings do include categories, make sure the canonical points to one consistent version.

Parameters, tracking codes and filters

Anything after a question mark creates a new URL for the same page. How you handle it depends on what the parameter does:

URL typeExampleWhat the canonical should do
Tracking parameters/offer/?utm_source=whatsappPoint to the clean URL, /offer/
Sort order/shop/?orderby=pricePoint to the unsorted category; the products are the same
Filters you don't want ranked/shop/?colour=red&size=mPoint to the main category, or noindex the filtered pages
Filter pages you do want ranked/sarees/silk/Make it a proper page with its own content and a self-referencing canonical

Google has retired the old URL Parameters tool in Search Console, so parameters now need handling on the site itself. On stores with many filters, canonicals alone may not stop Google crawling thousands of combinations; see WooCommerce product filters and SEO for how to keep filter URLs under control.

Pagination: don't canonicalise to page 1

Blog archives, category pages and product listings are often split across several pages: /blog/, /blog/page/2/, /blog/page/3/ and so on. A common mistake is pointing every one of them to page 1. Page 2 lists different posts or products from page 1, so it isn't a duplicate, and canonicalising it away can stop Google finding items that are only linked from deeper pages.

Google's guidance is to give each paginated page its own self-referencing canonical and to link the pages together with normal, crawlable links. Google has also said it no longer uses the old rel="next" and rel="prev" tags as an indexing signal, though they do no harm. Most SEO plugins handle paginated canonicals correctly; check yours if a theme or page builder creates its own pagination.

Cross-domain canonicals

A canonical can point to a page on a different domain. The usual use is syndication: if your article is republished on another site, the copy can carry a canonical pointing to your original. Be aware of two things:

  • The other site has to agree to add it, and Google may still show their version instead of yours.
  • At the time of writing, Google's documentation says a canonical isn't the most reliable option for syndicated copies, and suggests the partner blocks their copy from indexing with noindex instead. Check the current guidance before agreeing terms.

If you own two domains with the same content, such as a .com and a .in, or you've moved to a new domain, don't rely on cross-domain canonicals. Use 301 redirects so only one site exists; see changing your domain name without losing SEO.

HTTP vs HTTPS, www vs non-www and trailing slashes

If your site loads at http and https, and with and without www, each page technically exists at four addresses. If /page and /page/ both load too, there are eight. Canonicals help, but they aren't the main fix here:

  1. Pick one version, for example https://www.example.in/ with trailing slashes.
  2. 301 redirect every other version to it at server or host level. See 301 vs 302 redirects.
  3. Make canonicals, internal links and your sitemap all use that same version.
  4. Test by typing the http and the other www variant into a browser and checking where you end up.

A canonical that still says http after a move to https is a classic leftover from an unfinished migration.

Canonical vs redirect vs noindex

ToolUse it whenWhat visitors see
301 redirectThe old URL shouldn't exist any more: a moved page, a merged article, an old domainThey are sent to the new URL
CanonicalThe duplicate needs to stay accessible, but one version should rankBoth URLs still work
NoindexThe page shouldn't appear in search at all, such as a thank-you page or internal search resultsThe page works but isn't indexed

Don't combine a noindex with a canonical pointing to a different page; the two instructions contradict each other. And don't block duplicate URLs in robots.txt, because Google then can't crawl them to see the canonical at all.

How to check canonicals in Search Console

Google Search Console shows whether Google is following your canonicals:

  • URL Inspection: enter a URL and, in the page indexing details, compare the "User-declared canonical" with the "Google-selected canonical". If they differ, Google has overruled you.
  • Pages report (Indexing > Pages): look at the reasons listed for pages that aren't indexed.

Three statuses relate to canonicals:

  • Alternate page with proper canonical tag: usually fine. Google found a duplicate, saw your canonical and respected it.
  • Duplicate without user-selected canonical: Google found duplicates with no canonical and picked one itself. Add canonicals or redirects so you decide.
  • Duplicate, Google chose different canonical than user: Google disagreed with your canonical. Check whether the page really is a duplicate, whether internal links and the sitemap point to a different version, and whether the canonical target redirects or is noindexed.

For the other statuses in that report, see Search Console page indexing errors explained. Outside Search Console, view a page's source and search for "canonical", or run a site crawler that lists every page's canonical.

Common canonical mistakes

  • Canonicals pointing to a staging or old domain after a migration
  • All pages canonicalised to the homepage, which tells Google to ignore them
  • Canonical to a redirected, 404 or noindexed URL
  • Conflicting signals: the canonical says one URL, while the sitemap and internal links use another
  • Using canonicals instead of redirects when a page has permanently moved
  • Paginated pages pointing to page 1
  • Language versions pointing to the English page. Each language version should be its own canonical; see hreflang and multilingual SEO for Indian websites.

For the wider picture of why duplicate URLs appear and when they matter, see duplicate content explained.

Quick check: which canonical does Google use?

  1. Paste the address into the URL Inspection bar at the top of Google Search Console. Compare the User-declared canonical with the Google-selected canonical.
  2. Open the page, press Ctrl+U to view source and search for rel="canonical". There should be exactly one, pointing to the https address you want.
  3. In Google Search Console, open Indexing > Pages and look for "Duplicate, Google chose different canonical than user".

Canonical tags and robots.txt do different jobs; see WordPress robots.txt: safe example and mistakes before blocking duplicate URLs there.

When to get help

Get help when Google keeps picking a different canonical, when two plugins output canonical tags, or after a migration changed your URLs. WordPress SEO services covers this kind of work, with a written scope before anything starts. You can also send the details through the contact form.

FAQs

Is a canonical tag a ranking factor?

Not directly. It doesn't make a page rank higher on its own. It helps Google consolidate signals from duplicate URLs onto one page and show the URL you prefer, which can help that page compete.

Why is Google ignoring my canonical tag?

Usually because other signals disagree: internal links or the sitemap point to another version, the pages aren't actually duplicates, the target redirects or is noindexed, or there are two conflicting canonicals. Fix the signals, then request indexing again in URL Inspection.

Should I use a canonical or a 301 redirect?

Use a 301 redirect when visitors no longer need the old URL. Use a canonical when both URLs must keep working, such as a tracked or sorted version of a page.

Can I canonicalise similar product pages to one product?

Only if they're near-identical, such as the same product at two URLs. Different products, or variations people search for separately, should keep their own canonical; Google may ignore canonicals between pages that differ a lot.

How long does it take Google to respect a new canonical?

It depends on how often Google recrawls the pages involved; changes can take days or weeks to show in Search Console. Requesting indexing in URL Inspection may help Google notice sooner, but doesn't guarantee it will agree.

Need help with your website?

I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.

Found this useful? Share it:
Contact

Let's build your next website

Available for freelance projects, agency white-label work and long-term maintenance. Feel free to pass this along to your team or company.

I reply within 24 hours, usually the same day. Your details are emailed to me, then WhatsApp opens so we can chat right away.

Chat now