What Are Canonical URLs? The Canonical Tag Explained
A canonical URL is the single address you tell Google to treat as the official version of a page when the same content is reachable at more than one URL, and the canonical tag (rel="canonical") is how you declare it. Duplicates appear on almost every site without anyone creating them. Here is why, how to set canonicals properly, the mistakes I see most, and how to check which version Google actually picked.
Canonical URLs are the preferred versions of your pages, the ones you want Google to index and rank when the same content lives at several addresses, and the canonical tag, rel="canonical", is how you tell Google which address that is. If you are asking what are canonical URLs and whether a small business site needs them, the answer is that every site needs them, because duplicate URLs appear on their own: with and without www, with and without a trailing slash, with tracking parameters from an ad click, with .html on the end. This site had exactly that problem. At one point Google had indexed both shreyasbagal.in/what-is-local-seo and shreyasbagal.in/what-is-local-seo.html as two separate pages with identical content, and I will use that as the running example because I fixed it myself.
I set up canonicals as part of the technical foundation on every site I work on, before content or links, because signals split across duplicate URLs are signals wasted. This guide covers what canonical URLs are, the seven ways duplicates get created, how to set canonical tags on WordPress, Shopify, WooCommerce and hand-built sites, what a self-referencing canonical is and why you want one, the mistakes I keep finding on Indian business sites, and how to read the canonical reports in Google Search Console.
What are canonical URLs?
Google's index works at the URL level. If the same page is reachable at four addresses, Google sees four candidate pages and has to decide whether they are the same thing and, if so, which one to show in search. That chosen address is the canonical URL. Google will make that choice with or without your help: if you say nothing, it picks based on signals like which version is linked most, which is in the sitemap, which uses https, and which it found first.
The canonical tag is your vote. It is a single line in the head of the page:
<link rel="canonical" href="https://shreyasbagal.in/what-is-local-seo">
Placed on every version of a page and pointing at the preferred version, it tells Google to index that one and treat the others as copies. When Google agrees, three things happen. The duplicates drop out of the index, or never enter it. Links pointing at any version are counted towards the canonical, so the authority is pooled rather than split. And Googlebot spends less time refetching copies, which matters for the reasons I cover in what crawling is in SEO.
The word "hint" matters. Google says it treats rel="canonical" as a strong signal, not a directive, and it will override you when your tag contradicts the other evidence: if you canonicalise page A to page B but every internal link and the sitemap point to A, Google may keep A. Search Console tells you when this happens, and I show you where to look later in this guide.
Why duplicate URLs happen on every website
Nobody sets out to create duplicates. They come from how servers, platforms and marketing tools behave. These are the sources I check on every audit.
Protocol and hostname variants
http://yoursite.in, https://yoursite.in, http://www.yoursite.in and https://www.yoursite.in are four URLs for the same homepage. Most hosting setups serve all four unless you redirect them. Pick one (https, and either www or the bare domain, it does not matter which) and redirect the rest with a 301. This site redirects www to the bare domain at the hosting level.
Trailing slashes, index files and .html extensions
/services and /services/ can be different URLs. So can /index.html and /. On a static site, /page.html and /page are both valid if the server allows either, which is precisely how this site ended up with two indexed copies of its guides. Uppercase and lowercase paths on some servers are yet another pair.
Tracking parameters from ads and social links
Every click from a Meta ad, a Google ad, a WhatsApp broadcast or an Instagram bio link tends to arrive with parameters attached: ?utm_source=instagram&utm_medium=bio, ?fbclid=..., ?gclid=.... The page is identical, the URL is not. When I run Meta lead campaigns for clients at a cost per lead of 20 to 25 rupees, every landing page click carries UTM tags so I can attribute the lead, and every one of those tagged URLs is a potential duplicate if the page has no canonical. The same goes for the Instagram traffic from a Reels push that reached 742K+ views, 94% of it from non-followers, which sent thousands of tagged clicks to a single page. Tracking is not optional. Canonicals make it harmless. If you want the benchmark for what those campaigns should cost, see my note on a good cost per lead for Meta ads in India.
Filters, sorting and pagination on shops
Category pages on Shopify, WooCommerce and every other cart generate URLs for sort order, colour, size, price band and page number. Some of those pages deserve to exist; most are the same list rearranged. Handling them is a mix of canonical tags, robots rules and structure, and I go deeper on the structural side in schema markup for category pages.
Products reachable through several categories
Shopify can serve a product at /products/handle and also at /collections/sarees/products/handle. WooCommerce with category-based permalinks does something similar. One product, several addresses. Shopify handles this with an automatic self-referencing canonical on the /products/ version, and it is worth confirming your theme has not broken it.
Copies, syndication and print or PDF versions
Republishing a blog post on Medium or LinkedIn, offering a PDF brochure with the same text as a service page, or a print version of a page all create near-duplicates, some on other domains. Cross-domain canonicals and, on platforms like Medium, the import tool's built-in canonical handle these.
Development and staging copies
staging.yoursite.in or the vercel.app preview URL of a deployment can get indexed if it is publicly reachable. This site sends a noindex header on every vercel.app preview so only the real domain is indexable. A staging copy that gets indexed is a duplicate of your entire site, which is the worst version of this problem.
The real example: how this site had /page and /page.html both indexed
shreyasbagal.in is a hand-built static site hosted on Vercel. Every guide is an HTML file, so the file for the local SEO guide is what-is-local-seo.html. Vercel can serve that file at /what-is-local-seo.html, and with its clean URL setting it also serves it at /what-is-local-seo. Early on, the internal links used the .html form, the sitemap used the clean form, and nothing told Google the two were the same. Google, doing exactly what it is designed to do, indexed both. The Page indexing report showed the pair as separate URLs, impressions were split between them, and URL Inspection showed Google picking its own canonical for some pages, sometimes the .html version, sometimes the clean one.
The fix had four parts, and every part is a general lesson.
- One preferred format. I chose https, bare domain, no trailing slash, no extension: https://shreyasbagal.in/what-is-local-seo. Every decision below followed from that.
- A canonical tag on every page pointing at the clean URL. The head of each file got
<link rel="canonical" href="https://shreyasbagal.in/slug">, with the slug matching the file name without .html. Pages that had been pointing at the .html form were corrected. - Redirects at the hosting level. In vercel.json,
"cleanUrls": truemakes Vercel redirect any request for /slug.html to /slug with a 308, and"trailingSlash": falseredirects /slug/ to /slug. A host rule sends www.shreyasbagal.in to shreyasbagal.in. So even the old .html links resolve to the canonical after one hop. - A sitemap with only canonical URLs. The sitemap lists the clean form and nothing else, so Google's list of pages you want indexed matches the canonical tags exactly.
{
"cleanUrls": true,
"trailingSlash": false,
"redirects": [
{
"source": "/(.*)",
"has": [{ "type": "host", "value": "www.shreyasbagal.in" }],
"destination": "https://shreyasbagal.in/$1",
"permanent": true
}
]
}
Over the following weeks the .html entries moved out of the indexed list, showing up as "Page with redirect" and "Alternate page with proper canonical tag" instead, which are both correct outcomes rather than errors. Impressions that had been split consolidated onto the clean URLs. No content changed. The lesson I took from it: the canonical tag alone would have worked eventually, but combining it with a redirect and a consistent sitemap made Google's decision easy, and easy decisions get made faster.
How to set canonical URLs on your site
This is the sequence I follow, whether the site is WordPress, Shopify, WooCommerce, Wix or hand-coded. Steps 1 and 2 are about the hard duplicates that should never exist; steps 3 and 4 handle the soft duplicates that must exist but should not be indexed.
Step 1: Choose one URL format and write it down
Decide on https, www or bare domain, trailing slash or not, and lowercase paths. Write the rule in a note you can hand to any developer: all URLs are https://example.in/lowercase-path with no trailing slash. Every later choice, from redirects to sitemap to internal links, has to match this, and inconsistency is what created duplicates in the first place.
Step 2: Redirect the hard duplicates with 301s
http to https, the unused hostname to the chosen one, and the unwanted slash variant to the wanted one. These are server-level rules: .htaccess on Apache hosting, the Cloudflare dashboard, vercel.json, or your platform's domain settings. Wix, Shopify and Squarespace do most of this automatically once you set a primary domain. A redirect is stronger than a canonical because it removes the duplicate entirely; use it wherever the duplicate has no reason to exist.
Step 3: Add a self-referencing canonical tag to every indexable page
Every page that should be in Google gets a canonical tag pointing at its own preferred URL. On WordPress, Yoast SEO and Rank Math do this automatically for posts, pages and archives; check one page's source to confirm. Shopify adds self-referencing canonicals on products, collections and pages by default. WooCommerce inherits it from whichever SEO plugin you use. Wix and Squarespace add them automatically. On a hand-coded site, add the line to the head of every file, using an absolute URL including https and the domain, never a relative path. If your pages are built from a template, generate the tag from the page's own URL so it can never drift. The rest of the head, the title and description, is covered in my guide to meta tags for SEO, and you can generate those two with my free meta tag generator.
Step 4: Point the soft duplicates at the preferred URL
Parameter URLs, filter and sort variations, the .html twin of a clean URL, the /collections/x/products/y version of a product: each should carry a canonical pointing at the base page. For parameter URLs this happens automatically when the base page has a self-referencing canonical, because the tag names the base URL regardless of what is appended. For filter pages you may need a plugin setting or a template rule. Only canonicalise pages that are genuinely the same or nearly the same; canonicalising two different pages together is one of the mistakes I cover below.
Step 5: Make internal links and the sitemap use only canonical URLs
Every link in your navigation, footer and content should point at the canonical form, and the XML sitemap should list canonical URLs only. Google weighs these signals when deciding whether to trust your tag, and they are also what stops the duplicate from being rediscovered. My internal linking guide covers how to audit links site-wide, and a crawl with Screaming Frog will list every link target so you can spot stray www or .html forms.
Step 6: Check the tag in the source and in URL Inspection
Right-click a page, choose View page source, and search for rel="canonical". There should be exactly one, in the head, with the absolute preferred URL. Then paste the URL into Search Console's URL Inspection and compare "User-declared canonical" with "Google-selected canonical". They should match. My free website SEO checker also reports the canonical tag alongside titles, descriptions and structured data if you want a one-click check.
Step 7: Watch the Page indexing report for duplicate statuses
Over the next few weeks, open Indexing, then Pages, and look for "Duplicate without user-selected canonical" (you forgot a tag), "Duplicate, Google chose different canonical than user" (Google disagreed) and "Alternate page with proper canonical tag" (the good outcome for a duplicate). The numbers should move from the first two into the third. If they do not, something in steps 2 to 5 is still contradicting your tag.
Self-referencing canonicals: why every page should point to itself
A self-referencing canonical is a page whose canonical tag points at its own URL. It sounds redundant. It is the single most useful canonical you can add, for a simple reason: you do not control what gets appended to your URLs. An ad platform adds fbclid. A newsletter tool adds utm tags. A scraper copies your page onto another domain with your head intact. In each case the copy carries a canonical pointing back at the original, and Google has a clear instruction without you doing anything. Google's own guidance recommends it, and every major CMS does it by default. If your site does not, that is the first fix.
The one thing to get right is the exact URL. The self-referencing canonical must use the preferred format from step 1. A canonical that points at the http version of an https page, or the www version of a bare-domain site, is worse than none, because now you are actively voting for the duplicate.
Common canonical tag mistakes on Indian business sites
These are the errors I find during audits, roughly in order of how often they appear.
- Every page canonicalised to the homepage. Usually a theme or a copied template with a hard-coded tag. Google treats the whole site as duplicates of the homepage and drops the rest. Devastating, and common on cheap template sites.
- Canonical pointing at a URL that redirects or 404s. The tag says index this, and Google finds a redirect or nothing. Google ignores the tag and picks its own canonical.
- http canonical on an https site, or www on a bare-domain site. The format-mismatch error from the previous section. Check after any migration to https or any domain change.
- Relative URLs in the tag.
href="/page"is technically allowed but breaks the moment the page is served at an unexpected host, such as a staging copy. Always use absolute URLs. - Two or more canonical tags on one page. Yoast adds one, the theme adds one, a plugin adds a third. Google ignores all of them. Search the source for rel="canonical" and keep exactly one.
- Canonical combined with noindex. You are telling Google this is the main version and do not index it at the same time. Pick one. Noindex the page or canonicalise it, not both.
- Canonicalising different pages together. Pointing "dental implants in Baner" at "dental implants in Kothrud" because they are similar. Google will ignore the tag if the pages are not actually duplicates, and if it does honour it you lose a page you wanted. Different pages need different content, not a canonical.
- Paginated pages canonicalised to page 1. Old advice that Google explicitly says is wrong. Page 2 of a category is not a duplicate of page 1. Each paginated page should self-reference.
- Tag placed in the body or injected late by JavaScript. Google only reads rel="canonical" in the head. A broken tag earlier in the head, such as an unclosed script, can end the head early and push the canonical into the body where it is ignored. Verify with View page source, not just the rendered inspector.
- Canonical and sitemap disagreeing. Sitemap lists the .html version, canonical says the clean one. This was part of this site's problem. Google resolves the conflict on its own terms.
How to check canonicals in Google Search Console
Search Console reports canonicals in two places. In URL Inspection, the Indexing section of the result shows "User-declared canonical" (what your tag says) and "Google-selected canonical" (what Google decided). If they match, you are done. If Google-selected shows a different URL, or the inspected URL is missing from the index while another version is present, Google has overruled you.
In the Page indexing report, three reasons in the "Why pages aren't indexed" table relate to canonicals:
- "Duplicate without user-selected canonical": Google found duplicates and no tag on this URL. Add the tag.
- "Duplicate, Google chose different canonical than user": your tag pointed at X, Google chose Y. Almost always a contradiction in signals: internal links, sitemap or redirects favour Y. Fix the signals to agree with the tag, or accept Google's choice if it is sensible and update the tag to match.
- "Alternate page with proper canonical tag": this URL is a duplicate and correctly points at the canonical. This is not a problem. It is the report confirming your setup works. New site owners panic over this one, and there is no need.
When Google disagrees with you repeatedly on a page, look at which version has more internal links, which is in the sitemap, which has external links, and which loads faster. Google is telling you what its evidence says. The fix is usually to make your own signals consistent rather than to argue with the tag. And if the issue is bigger than canonicals, the broader diagnosis in why your website is not showing on Google walks through the full list.
Canonical tags versus redirects versus noindex
Three tools get confused with each other, and each does a different job.
| Tool | What it does | Use it when | Examples |
|---|---|---|---|
| 301 redirect | Sends users and Google to another URL; the original stops serving a page | The duplicate has no reason to exist | http to https, www to bare domain, an old URL after a rename |
| rel="canonical" | Both URLs stay live; Google indexes the preferred one and pools signals | The duplicate must stay reachable | UTM links, filter pages, .html twins, syndicated copies |
| noindex | Page stays live and crawlable but is kept out of the index | The page is unique but should not appear in search | Thank-you pages, internal search results, thin tag archives |
Redirect what should not exist, canonicalise what must exist but should not compete, noindex what is unique but not for search. Pair this with the robots.txt rules for crawl control and you have the whole toolkit. For the wider foundation these sit inside, my guide to technical SEO basics for business owners puts canonicals in context with sitemaps, speed and mobile.
Frequently asked questions
What is the difference between a canonical URL and a redirect?
A redirect sends both visitors and Googlebot to a different URL, so the original address stops serving a page at all. A canonical tag leaves both URLs live and working but tells Google which one to index and credit. Use a redirect when the duplicate has no reason to exist, such as http versus https or www versus non-www. Use a canonical when the duplicate must stay reachable, such as a URL with tracking parameters or a filtered category page.
Should every page have a canonical tag?
Yes. Every indexable page should carry a self-referencing canonical tag pointing at its own preferred URL, and every duplicate version should point at that same URL. Most platforms, including WordPress with Yoast or Rank Math, Shopify, Wix and Squarespace, add self-referencing canonicals automatically. Hand-coded sites need the tag added to the head of every page, using the absolute URL with https and the domain.
Why did Google choose a different canonical than the one I set?
Because your other signals contradicted the tag. Google treats rel=canonical as a strong hint, not a command, and weighs it against internal links, the XML sitemap, redirects, external links and which version it found first. If your sitemap lists the .html version while your tag points at the clean URL, or most of your internal links go to the www version, Google may side with the evidence. Make the sitemap, internal links and redirects all agree with the tag and the mismatch usually resolves within a few weeks.
Do canonical URLs affect rankings?
Indirectly, yes. A canonical tag is not a ranking factor, but it decides which URL collects your ranking signals. Without it, links and engagement get split across duplicates, and Google may index a version you did not intend, such as a parameter URL. With correct canonicals, every signal for a page pools onto one URL, Googlebot spends less time on copies, and the version you chose is the one that appears in search. Fixing duplicate URLs is one of the cheaper technical wins available to a small site.
How do I find the canonical URL of a page?
Open the page, right-click, choose View page source, and search for rel=canonical. The href value in that link tag is the declared canonical. To see what Google decided, paste the URL into the URL Inspection tool in Google Search Console and compare User-declared canonical with Google-selected canonical. My free website SEO checker at shreyasbagal.in/tools/website-seo-checker/ also reports the canonical tag along with the title, description and structured data on any page.
Related guides
- What is crawling in SEO? How Googlebot finds your pages
- Schema markup for category pages: what belongs there
- Technical SEO basics every business owner should know
- What is robots.txt in SEO?
- Internal linking strategy guide
- WordPress vs Wix vs Shopify: which is best for your business?
- Free website SEO audit in 5 minutes
- Why is my website not showing on Google?
Your next step
Pick three pages on your site, view the source of each, and confirm there is exactly one canonical tag pointing at the URL format you want. Then run each through the free website SEO checker and work down the on-page SEO checklist for 2026. If Search Console is showing "Duplicate, Google chose different canonical than user" on pages that matter to you, send me the URLs and I will tell you which signal is contradicting your tag.
Get new guides in your Google Search & Discover feed.