Guide
Canonical tag: what it is and how to use it
A canonical tag is HTML code that tells search engines which version of a page is the main one. Learn what it does, when to use it and how to add it.
By Pratik Geet7 min read
A canonical tag is a short piece of HTML code, written as rel="canonical", that sits in the head section of a web page and tells search engines which URL is the main version of that content. You use it when the same content can be reached at several addresses: the copies point to the main page, so search engines know which version to index and rank.
That is the whole idea. The rest of this guide explains why it matters, how it differs from a redirect, and how to write the tag yourself, with a worked example you can follow on your own site.
What does "canonical" mean in simple terms?
In everyday English, canonical means the accepted, official version of something. In SEO it means the same thing: the canonical URL is the address you want search engines to treat as the real page.
The tag that says this is called a canonical tag. You will also see people search for it as rel canonical, link rel canonical or HTML canonical. These are different ways of naming the same piece of code, which is added to the head section of a page rather than to the text your visitors read.
There is a second term worth knowing. A canonicalised URL is a page that uses a canonical tag to name a different page as its main version. So the main page is the canonical, and each copy that points to it is canonicalised.
What is the use of a canonical tag?
Websites create duplicate pages more often than owners realise. A product can appear under several categories, a blog post can open with or without a slash at the end of the address, and tracking codes can be added to links shared in emails or adverts. To a person, these all look like the same page. To a search engine, each address can look like a separate page.
Without a canonical tag, search engines do not know which version to index and rank. That can split your ranking strength across the copies and harm how the page performs in search.
A canonical tag settles the question with a clear answer. It helps combine the ranking strength, often called link equity, of the duplicate pages into the main version. Link equity is simply the value a page earns from the links pointing to it. Canonical tags also make it easier for search engines to crawl and index your site.
So when people ask what a canonical link does, the short answer is this: it gathers the copies of a page behind the version you chose, instead of letting them compete with each other.
Are canonical tags necessary?
If every page on your site lives at a single, clean address, there is little to fix. Most real websites are messier than that, especially online stores, booking sites and blogs with filters and tracking links. On those sites, leaving duplicates without a canonical tag means search engines have to guess, and the guess can weaken your rankings.
What is the difference between a URL, a canonical URL and a redirect?
A URL is simply the address of a page. A canonical URL is the address you have marked as the main version with a canonical tag. A canonicalised URL is a copy that points to it.
A redirect is a different tool. A 301 redirect is a permanent redirect: anyone who visits the old address is sent on to the new one. Search engines weigh a 301 redirect more heavily than a canonical tag, and it is the default choice when a URL should disappear for good.
| Canonical tag | 301 redirect | |
|---|---|---|
| What it does | Names the main version of a page, while the copies stay where they are | Sends visitors and search engines from an old address to a new one |
| How search engines treat it | As a strong hint, not a rule | As a stronger signal than a canonical tag |
| When to use it | The copies still need to stay live, such as filtered or tracked versions | The old address should disappear for good |
A simple way to decide: if people still need the copy, use a canonical tag. If the old page should no longer exist, a 301 redirect is the stronger choice. They are not the same thing, and swapping one for the other can confuse search engines.
How to generate a canonical tag: a worked example
Here is a made-up example to show the steps. Say an online store in India sells a cotton kurta. The product page opens at its normal address. It also opens with a slash added at the end, and with a tracking code added after a question mark when the link is shared in a newsletter. A search engine may see each of these as a separate page.
The fix is to place a canonical tag on the duplicate versions that points back to the URL of the main page. Here is how to do it.
- Choose the main address. Pick the clean version you want people to find in search, usually the plain address with no tracking code.
- Copy it exactly. A canonical tag breaks if the URL inside it does not exactly match the live page's protocol, trailing slash or parameters. The protocol is the https:// at the start, and parameters are the extra bits after a question mark. Copy the address from the live page, not from memory.
- Write the tag. It looks like the line below, with your main address in place of the words in brackets.
- Add it to the head section. Put the tag in the head section of each duplicate version, so that every copy points to the same main address.
- Check it is live. Open the page, view its source code and confirm the tag appears in the head with the right address.
```html <link rel="canonical" href="[exact main address of the kurta page]"> ```
You can also add a tag on the main page that points to itself, called a self-referencing canonical. The same rule applies: it must match the live address exactly, or it breaks.
After the fix, shoppers can still open the tracked link from the newsletter and land on the kurta page as before. Nothing changes for them. What changes is the note in the page code, which now tells search engines plainly which address you want them to show.
Does Google always follow canonical tags?
No. Google treats every canonical tag as a strong hint, not a rule it must obey. Google usually follows them, but it may override a canonical tag when it detects stronger signals, such as redirects, internal linking patterns or user behaviour.
In practice, this means your signals should agree with each other. If your canonical tag points to the main page but your internal links keep pointing to a copy, you are sending mixed messages, and search engines may choose the copy. Keep your menus and internal links pointing to the main address, and use a 301 redirect instead when a page should go away for good.
No one can promise that a search engine will use the version you chose. What you can do is make the choice clear and consistent across the whole site.
Common canonical tag mistakes
- An address that does not match. A missing slash, a different protocol or an extra parameter in the tag is enough to break it.
- Using a canonical tag when a page should disappear. A 301 redirect carries more weight and suits that job.
- Internal links that point to the copies. These are the kind of stronger signals that can lead Google to override your tag.
- Treating the tag as an order. It is a strong hint, so the rest of your site needs to back it up.
How Deylaxy handles canonical tags
Canonical tags are part of the technical SEO fixes Deylaxy provides, along with redirects, indexing, robots.txt, sitemaps and schema. Safe fixes are applied directly on WordPress or Next.js sites; others go to your developer as exact step-by-step tasks, and then we check them live.
We make the SEO changes on your website for you, rather than just sending a report. Nothing goes live without your approval, or you can choose to let small changes go ahead if you do not reply.
If you are not sure whether your site has duplicate pages, a free website visibility audit shows how your website shows up in Google and in AI answers, including technical issues and the top fixes in priority order.
Frequently asked questions
How do you put a canonical tag on a page?
Add a link tag with rel="canonical" to the head section of each duplicate page, pointing to the exact address of the main version. Copy that address from the live page, because the tag breaks if the protocol, trailing slash or parameters do not match exactly. Then view the page source to check the tag is in place.
What is a canonical example?
A simple example is a product page that opens at its normal address and also at a version with a tracking code added. You place a canonical tag on the tracked version that points back to the URL of the main product page. Shoppers can still use both links, while search engines are told which address is the main one.
What is the difference between a canonical tag and a 301 redirect?
A canonical tag names the main version of a page while the copies stay live, and search engines treat it as a strong hint. A 301 redirect permanently sends visitors and search engines from an old address to a new one. Search engines weigh a 301 redirect more heavily, so it is the default choice when a URL should disappear for good.
Related reading
Sources
- seotesting.com, canonical tags
- en.wikipedia.org, Canonical link element
- mangools.com, canonical tag
- yoast.com, rel canonical
- tenspeed.io, canonical tags
Add Deylaxy as a preferred source on Google
Related on our website
More on this subject from us:
Read Deylaxy first on Google