rel=”canonical” This tag has been launched for a long time. Canonical is a tag launched by search engines such as Google, Yahoo, and Microsoft. Its main function is to solve the problem of content duplication caused by the same content in different URL forms. This tag is very useful for search engines. Simply put, it allows search engines to crawl only the content you want to emphasize.
As a simple example, consider the following URL:
http://www.yzznl.cn/archives/2011-snow.html
http://www.yzznl.cn/archives/2011-snow.html?comments=true
http://www.yzznl.cn/archives/2011-snow.html?postcomment=true
These three URLs have different forms. The first one is the URL we want to display to search engines and users, but the content of opening their websites is the same. Generally, in this situation, it is difficult for search engines to distinguish which URL the website owner wants to emphasize. This will directly cause the search engines to include a large amount of duplicate content in your site. Now we can solve this through the canonical tag. Tough question.
Like the situation above, we only need to add the following code to the head area of the URL:
<link rel='canonical' href='http://www.yzznl.cn/archives/2011-snow.html' />
In this case, search engines such as Google will eventually only include the URL specified by the canonical tag, and the search engines will regard other pages as duplicate content, and these duplicate contents will no longer participate in the weight distribution of the page (such as Google's PR value).
How to use canonical in WordPress
If you are using WordPress, as long as the version is WordPress 2.9 and above, the canonical tag should be supported by default. For versions before 2.9, you can manually add the following code to the head area of the header.php file of your theme:
<?php if(is_single()){?>
<link rel="canonical" href="<?php echo get_permalink($post->ID);?>" />
<?php } ?>
Source of article: Please indicate the source link when reprinting on Yuanzi Blog.