Canonical Tag first time introduced by Bing and Yahoo in 2009.
Canonical is a simple HTML tag which tells to search engines about the original version (page).
Syntax is –
<link rel=”canonical” href=”https://example.com/sample-page/” />
We put original url in canonical tag in all duplicate pages.
We put here full url with protocol (http/https).
Example – https://example.com/sample-page/
Where to put Canonical Tag
1. Head section
Best practice is, put your canonical tag in the html head section. I will say, show first thing in the page is your canonical to search engines.
Suppose you have two duplicate page. /page-1/ and /page-2/
And here /page-1/ is an original page. In that case we will add given canonical tag on /page-2/ page which is added in the HTML head section.
<link rel=”canonical” href=”https://www.example.com/page-1/” />
What will happen if use canonical in <body> section
Google will ignore it, because as per google statement, hackers use this trick.
Even you forget to close your heading tag (<head>), may be google ignore your canonical tag.
2. Http header (Optional)
You can add canonical tag in http page header.
How to add canonical tag for PDF file?
You cannot add canonical tag in head section for pdf file.
in that case – you have to add this tag in http header.
Syntax for Http header –
Link: <http://www.example.com/downloads/white-paper.pdf>; rel=”canonical”
Use Canonical for Duplicate Content
We use it for Duplicate/Similar/Near-Duplicate Content.
If you have multiple pages for the same content, you can tell to search engines that which one should index. Some time it happens that google may index wrong version.
Above both pages have same content (suppose), it may be possible google may crawl session id version and exclude real page. To avoid this type of issues we should use canonical tag.
Due to duplicate content your crawl budget may be waste, backlinks may be divide and it may effect your ranking.
Examples of Duplicate Pages where we use Canonical
Check out here one by one duplicate content types where we can put canonical tag.
- Session ID Pages
When developers add some tracking and other functionality in the website, Due to this session id urls has been created. Generally, these pages are not visible easily but Google find them some time. Mostly these pages are duplicate pages. By using canonical tags you can get rid of these pages.
- WWW and Non-WWW Versions
Technically www and non-www both are duplicate page for search engines, we should tell to google which version should crawl. You can use here canonical tag and avoid duplicate issue.
- Http and Https Version
After announcing by Google, https is a ranking factor, most of the webmasters are shifting their site from http to https. But they forgot to tell search engines that they have two versions and index one https version. In that case big blunder happen, for some pages google pick http and for some pages google pick https. So best way is, tell to search engine about this changes. You can use here canonical tag.
- UTM Campaign Pages
We use utm urls for PPC, Adwords, Fcaebook paid marketing campaigns which are duplicate page. For these page we add canonical tag.
- Sorting/Filter pages (sub-content)
Suppose user lands on cloths product page which have 50 items and then apply two filters, first is color and second is size and then you shows 17 items from the 50 items. This is a basically sub-content and duplicate content of the product page (cloths). In that case we should use canonical tag.
- Print and PDF version Pages
Many blog sites provide print version and pdf version to users so they can read later and save it. These page also a duplicate content, here we can use canonical tag.
- Mobile pages
If you are running multiple device versions then use canonical for them.
- AMP pages
AMP page is also a duplicate page, we should use canonical tag for these pages too.
- Forward slash and without Forward slash pages
Most of the people think Google understand this by itself but for google without slash and with slash both are different url and create duplicate page issue and also impact url structure. That’s is why we use canonical tag here.
- Other version of country, language pages (Hreflang pages)
Other language and country urls also a duplicate page, we should tell to search engine about them and use canonical tag for them.
- Small letter and capital letter pages
Both are different url for google and we should use here canonical tag. Small letter url should be our main version.
You know we can put different content on both version that’s why search engine take it differently.
- Comment reply (in WordPress)
This is very old issue in WordPress sites which is not resolved in many WordPress themes. In that case every comment make their own page which is duplicate url and we should use here canonical tag.
- Cross domain (Multiple sites having same content)
I don’t know why website owners do this but it is bad SEO practice making multiple sites on same content. It does not help by the way. If you have these type of sites, must use canonical tag for them.
- A/B Test Pages
Generally we do small changes for A/B test and which are crawled by search engines. They are also a duplicate pages, in that case we should use canonical tag.
- Same section in multiple categories
Sometime ecommerce websites generate multiple categories for the same products and this technique can increase duplicate page issues. For that kind of issues we should use canonical tags.
- Default Home Page
Programming language create their default page for home page.
In that case these are canonical pages or duplicate pages. Here we can use canonical to remove duplicate issue.
Can Canonical Tag Effect Crawl Budget?
Yes, it can help you in crawl budget. Google will only crawl your main version and will exclude other duplicate versions. In that case – Google will crawl less pages which help to improve the crawl speed.
Does Google guaranteed consider canonical tag?
No, if google finds that non-canonical version is better than canonical version (original) than google will pick that one.
Sometime google may show both version. It may happen on those cases where content is not much duplicate.
In short, there is no guarantee that google will consider your canonical tag.
Canonical tag pointing back to itself is fine?
Yes, absolutely. I will say must use canonical for All pages.
If you don’t have duplicate content, still use it even for original pages, that is fine. And I will say, it is good seo practice. Because we don’t know future urls, query string urls may be created by others or may be by developers. For future security you can use same canonical page on same url. Google also recommend this.
Many canonical issues can be fixed by using this trick.
For example. Https, Forward slash, string urls, capital urls and many duplicate url issues can be resolved by this trick.
Should we use canonical for pagination and site search?
People point all pagination pages to default page which is wrong because paginations are not duplicate content.
www.example.com/cloths (default page)
www.example.com/cloths/page1 (pagination page)
Same scenario for search pages.
www.example.com/sample (default page)
www.example.com/sample?search=cloths (search page)
Better option is noindex them if they are a lot otherwise don’t do anything, Google will handle this by itself.
Does Canonical tag pass link juice (PageRank)?
Yes, canonical tag passes link equity to the original page same way as 301 redirect pass. Google also mentioned it in their document.
In other words, if page B canonicals to page A. links to page B will be counted as links to page A.
Canonical for Syndicate Content
If you are posting any press release/news/blog/article on multiple sites, then must use canonical tag.
If you are using exact same content from other website or your competitor website, then must use canonical otherwise you will punish for copywriting.
How to add canonical in WordPress website?
- Install Yoast Plugin
- Go into the page edit mode
- Go to the snippet area in the bottom
- And here you can add your canonical.
What things to avoid while using canonical tag?
Google may confuse or may be ignore your canonical tag if you will do given mistakes.
- Don’t block canonical url (original url) by robots.txt
- Don’t add noindex for canonical url.
- Make sure canonical url does not have 4xx and 5xx error
- Use one canonical tag per page, in case of multiple, google ignores all.
- Avoid multiple chain and looping of canonical tag
- Don’t use URL removal tool for canonical url
- Don’t specify different canonical url for the same page
- In case of canonical and noindex both tag, google pick noindex.
- Make sure url in sitemap and in canonical tag must be same.
What will happen if use same canonical tag (pointing to home page) for entire website
Accidently developers do this mistake many times, keep your eye on this otherwise all pages will be deindexed.
Canonical Tag Vs. 301 Redirection which one is best
We use both techniques for duplicate pages but 301 is fast and safe way as per my personal experience. I will recommend 301 instead of canonical tag.
But in some cases you cannot use 301 redirection.
For example, product items are filtered by their size or color and you can’t redirect these pages to main product page. so in that case you have to add canonical tag instead of redirection.