Wednesday, 16 April 2014

All About Canonical Tag and Its Implemetation

Narrative

A canonical tag is a simple piece of HTML code that you insert into the section of a duplicate page, letting the search engines know that they are on a duplicate page and they need to find the original content elsewhere, and guide them there.

It is mainly used in blogs or website where there is similar content on multiple pages. Canonical is not a tag, it’s an attribute of “link” tag, but it is popular with the name canonical tag. The tag is part of the HTML header on a web page, the same section you'd find the Title attribute and Meta Description tag. In fact, this tag isn't new, but like nofollow, simply uses a new rel parameter.
<link rel="canonical" href="http://www.example.com/blog" />
The tag is only used on duplicate pages, which tells search engines to redirect any link to this page to the original page.
According to Google, the canonical tag is not a directive but it is “a hint that we honor strongly. We'll take your preference into account, in conjunction with other signals, when calculating the most relevant page to display in search results.”
Canonical tags can be chained (e.g. page 3 refers to page 2 which refers to page 1 → link power from pages 2 and 3 go to page 1). This practice is not recommended but permitted.

Where to use canonical tag
Canonical tag can be used as:
1         Basic Use: To inform Google about duplicate pages and ask them to redirect to new pages. This is the case with blog sites where same content (post) is listed under multiple categories. We should add canonical tag on duplicate pages pointing to original post URL.

2         To ask Google not to crawl secure URL: Canonical tag work between secure and unsecure pages, so we can inform Google to crawl some other unsecure URL instead of secure one.
http://www.example.com vs. https://www.example.com

                We simply need to add canonical tag on secure page. Same is the case for below example.
http://www.example.com vs. http://example.com 

3         A site that generates different URL’s for products based on “sort by” choices.

4         When you add tracking codes or session ID’s to track the user’s path through the site, therefore resulting in different URL’s for each parent page.

5         In discussion forums, replies/comments to each thread/question may be set up to look like separate files while the content is almost identical. This leads to lots of pages that look like duplicate content.

Live Example of Canonical Tag:

You can find live example of canonical link element at http://starwars.wikia.com/wiki/Nelvana_Limited which specifies its rel="canonical" as: http://starwars.wikia.com/wiki/Nelvana. Above two URLs have similar content except first URL contains a message near heading.


How to implement canonical tag in word press?

We use WordPress for DPFOC and client’s blog; let’s see how to use canonical tag in WordPress. 
To implement canonical tag in WordPress and other popular CMS like Drupal, Magento E-Commerce etc, you may need plugins. You can find plugins here http://yoast.com/canonical-url-links/.

In WordPress, you can use the following plugin to implement canonical tag http://yoast.com/wordpress/canonical/ . Once you have installed this plugin via WordPress admin control panel, you have to activate plugin as shown in figure below and you are done; this will automatically add canonical tag accordingly. For support information of this plugin you can visit WordPress forum http://wordpress.org/tags/canonical.


Now suppose somebody tagged your blog’s URL on social media sites like twitter, facebook. By following that link on twitter, user will visit your post but sometimes social media site adds more parameter to the URL (it could make it dynamic). As you have already used canonical tag so Google will find the canonical and in this way you will not suffer from duplicate content issue.


Difference between 301 redirect and canonical tag
The Canonical URL tag attribute is similar in many ways to a 301 redirect from an SEO perspective. There are some differences, though:
1         A 301 redirect re-points all traffic (bots and human visitors); the Canonical URL tag is just for engines, meaning you can still separately track visitors to the unique URL versions.

2         A  Canonical tag can serve as a great quick fix for redirect, where we are not able to use 301 redirect. To use 301 redirect in Linux Web Servers, we should place 301 redirect codes in “.htaccess” file. In case of Windows (IIS) Server, “web.config” file is used for placing 301 redirects. For more information on placing 301 redirects in “web.config” file, go to the research doc named “ASP. NET Redirects” .

3         When moving mass URLs - If canonical used, then search engines have to crawl and index all old pages first to find canonical on them and then they will move to new URL. This will increase load on server. If, 301 redirect is used, search engines would automatically be redirected from old page to new page which eliminates the need of indexing old page and hence, decreases load on server.


FAQ (Published by Google)

1         Can I use a relative path to specify the canonical, such as <link rel="canonical" href="product.php?item=swedish-fish" />?
Yes, relative paths are recognized as expected with the <link> tag. Also, if you include a <base> link in your document, relative paths will resolve according to the base URL.

2         Is it okay if the canonical is not an exact duplicate of the content?
We allow slight differences, e.g., in the sort order of a table of products. We also recognize that we may crawl the canonical and the duplicate pages at different points in time, so we may occasionally see different versions of your content. All of that is okay with us.

3         What if the rel="canonical" returns a 404?
We'll continue to index your content and use a heuristic to find a canonical, but we recommend that you specify existent URLs as canonicals.

4         What if the rel="canonical" hasn't yet been indexed?
Like all public content on the web, we strive to discover and crawl a designated canonical URL quickly. As soon as we index it, we'll immediately reconsider the rel="canonical" hint.

5         Can rel="canonical" be a redirect?
Yes, you can specify a URL that redirects as a canonical URL. Google will then process the redirect as usual and try to index it.


Canonical tag in SEO process

Canonical tag is very important in terms of SEO as it help in removing (identifying) duplicate content from Google index. SEO executive should implement canonical tag on following occasions:
      If client have blog/forum, then use proper plugin to implement canonical tag.
      Should be used if there is same/similar content on client’s website.

SEO executive can recommend the use of canonical tag at the time of on-page recommendation. Alternatively, he/she can consult technical SEO executive to implement the same.

Using rel=”next” and rel=”prev” ( Much like Canonical )

If you are going to target a website that has paginated structure like a directory website, you should use pagination tags. Much like rel=”canonical” acts a strong hint for duplicate content, you can now also use the HTML link elements rel=”next” and rel=”prev” to indicate the relationship between component URLs in a paginated series.

Refer to:


Conclusion
By using the canonical tag, SEO executive can ensure that search engines are seeing the original page (the parent page) and not numerous, identical, or almost identical pages – which could be possibly a sign of spam or take up valuable space in search results. It is the biggest change to SEO best practices since the emergence of Sitemaps. However webmaster must use canonical tag wherever 301 redirect is not possible.

No comments:

Post a Comment