Dj Techblog

A blog on web development

Faqs about canonical and alternate link tags

Last modified on Feb 20, 2021
Faqs about canonical and alternate link tags - SEO

For new bloggers there are lot of challenges in optimizing their blog for the search engines. Forget about ranking in the search engine, they often find it difficult to even index their pages. Let me first tell you SEO for blogs or any online business is not difficult to achieve. But you need to invest some time and patience in order to attain desired result. Before you start SEO, first clear all you doubts. Believe in what you know, do the required change and keep patience till you get the desired result.

Here, in this blog I will clear some basic doubts which new bloggers, digital marketing intern and beginners often confuse.

Difference between canonical and alternate tag

Generally speaking, Canonical tags declare which is original content and altenate tags says what are duplicate content. Original contents are indexed but duplicate are discarded by search engine.

In a website you may have same content spread across multiple pages. Say, you are running an e-commerce website in which you have a page mens_shirt.html, as the name suggest, this page will conatin all the variations of shirts. You also have a page which shows the result when someone searches for the men's shirt in your website, say this page is search.php. You can see that there are two pages but they have different urls. In general search engine will try to crawl, read and index both the pages. Here the problem arises, the search engine will find duplicate content and might drop either one of the pages. It is upto the search engine that which page it will index and which will be discarded. You can see that control is not in your hand. But if you want control how search engine index you webpages, mark the page as canonical which you want to be indexed. All other pages need to be marked as alternate pages.

The above scenario can be understood this way also. Say you have a blog content written in multiple languages. Since, this also creates duplicte content you may want seach engine to index one specific page only. All the rest pages will be termed as alternate and will not be indexed.

How to use canonical and alternate tags in a webpage?

Say, you have one article written in three different language, article1-eng.html article1-fr.html and article1-ru.html.

Write the below code in the all the three pages.

<link rel="canonical" href="article1-eng.html" />
<link rel="alternate" hreflang="fr" href="article1-fr.html" />
<link rel="alternate" hreflang="ru" href="article1-ru.html" />

The above code will set your article which is written in english language as canonical and this page will be indexed by the search engine. Rest of the two pages will be set as alternate pages and will not be indexed but. But if request comes from a country and you have written article in the default language of that country. Alternate pages will automatically be served by search engine in that case. For example if any request from France then page written in french langauge will be served that is article1-fr.html. similarly, if request comes from Russia, article1-ru.html will be served. For any other geographical location canonical page will be served.

Why do we need canonical tags in all the alternate pages?

We need to put canonical tags in all the alternate pages that we have created. Not putting canonical tags in all the alternate pages might confuse search engines. Say search engine crawling a webpage and it finds alternate tags, then it understands it is a duplicate page and there in no need to index this page. But search engine find it difficult to identify the original page that is the canonical page of this duplicate page.

How to stop search engine to automatically translate the page

<meta name="google" content="notranslate" />

The notranslate tag will restrict the google search engine to automatically translate your webpages into user's default language. You can manually write your content in more than one language and set alternate pages for them and let search engine serve those to the users. So, this way you can increase your web reach to a large geographical location.

Are canonical and alternate tags mandatory for SEO

No, canonical and alternate tags are not at all mandatory from SEO point of view. You need to use this tags only when you have duplicate content or alternate pages. If you do not have duplicate page contents, you need not use this tag.

Do we need canonical tags for AMP pages also

As already stated canonical tags are necessary in case of duplicate pages. Since AMP pages are considered duplicated mobile version of desktop pages. We need to include canonical tags in amp pages also. In amp pages we need not include alternate tags but do not forget to use amphtml tag.

If you like this article, share with your friends. It will inspire me to write more.

Published on Feb 20, 2021


Intro

Debabratta Jena

I mainly write about HTML5, CSS3, Javascript, Angular JS, Ajax, PHP, Mysql, On page SEO, Google Ads, Tag manager, Universal Analytics, Google My Business, SERP, Apache server configuration etc, Yoga is my passion.

Reach to me in the contact us form below

Follow me on

Contact us

Subscribe

Tags

Php HTML5 Javascript CSS Ajax Angular JS Google My bisiness Listing Google tag Manager Google Universal Analytics Search Engine Optimization On page SEO Off page SEO Google Marketing platform Digital Marketing Google Ads Mysql Apache Server

×

Subscribe to get email notification about our new post

Name

Email

We neither sell nor share your personal information with any third party. Your identity is safe with us.