WordPress Wp-pagenavi Plugin Add nofollow

Source: Internet
Author: User
Keywords WordPress

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Alphen found a lot of Friends SEO Blog station are using WordPress program to do, have to say WordPress program is very suitable for making blog station, Alphen station is to use WordPress program to do. WordPress Paging Plug-in Wp-pagenavi (Chinese name: Paging navigation) is very popular paging plug-ins, and also support WordPress multi-site, Alphen SEO blog with this plugin.

Wp-pagenavi plug-in add nofollow reason:

A large number of paging links appear in search results, which seriously disrupts my search results, as pagination with links brings two questions:

Separate home weight

Cause Duplicate Collection

This is very unfavorable to the website optimization, but also very good solution. For the separation of the weight of the first page, we can add nofollow tag to the category link to solve. However, there are many factors affecting the weight of the site, if you do not know, the operation will be inadvertently lost weight of the site, repeat the problem we can be in the robots.txt file shielding.

Next, Wp-pagenavi plug-ins add nofollow:

Look up the information on the Internet, find the previous version of the Wp-pagenavi plugin is in the core.php file, select the wp-pagenavi/core.php file in the plugin, search class= ' $class ', plus rel= ' nofollow ' in front of it. But the latest Pagenavi plug-ins do not work, it seems that the new version of the larger changes, and then search the next plug-in source code, search is the href keyword, or core.php file has this keyword, see in the 243 lines have the following code to show: (Please open the view with DW)

function Get_single ($page, $raw _text, $attr, $format = '%page_number% ') {

if (Empty ($raw _text))

Return ";

$text = Str_replace ($format, number_format_i18n ($page), $raw _text);

$attr [' href '] = $this->get_url ($page);

Return HTML (' A ', $attr, $text);

}

It seems that HTML is a function that searches this function and finds that the function is defined in the wp-pagenavi/scb/util.php file.

In line 265: return "<{$tag}>{$content}"; This is the returned value of the HTML tag generated by the function, which, according to the HTML syntax, adds rel= ' nofollow ' to the tag and modifies the code to:

Return "<{$tag} rel= ' nofollow ' >{$content}";

Save page, refresh effective!

However, WordPress blog is not only the existence of plug-in optimization and Code label optimization problems, other programs do the site is also needed. If you do not understand the code, do not know how to build a station, it is difficult to say that you do the site is the most suitable SEO optimization. Recommend you to do SEO friends, you can understand the simple HTML code, will be optimized is very helpful. If you would like to know more about Code label Optimization Tutorial, please visit my blog.

This article original address: http://www.afengseo.com/736.html reprint Please specify

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.