How to add ‘NoFollow’ to WP-PageNavi

Yesterday, when I checked my blog, I found a problem. My blog is created by WordPress, so I used the WP-PageNavi Plugin. However, it hasn’t added ‘rel=nofollow’ on links.

You know, it is not friendly to seo. I found the solution by visiting the internet.

Picture 1:

wp-pagenavi-nofollow

This is source code.

<div class='wp-pagenavi'>
<span class='pages'>Page 1 of 14</span><span class='current'>1</span>
<a class="page larger" href="http://www.linhun.com/page/2">2</a>
<a class="page larger" href="http://www.linhun.com/page/3">3</a>
</div>

Obviously it hasn’t added ‘nofollow’ on links.

To add ‘NoFollow’ to WP-PageNavi

1. Log in your wordpress admin panel and Editor plugins

nofollow2

2. Select the Plugin (WP-PageNavi) and Click it.

nofollow3

3. See this picture, select this .php file (Util.php)

Page Navi Util PHP

4. Modify the code

nofollow

About 410 line;

Change:

return "< {$tag}>{$content}";

Replace:

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

5. Click ‘Update File’ Button;

6. Finish;

Related Posts

How to remove xmlrpc pingback ping for WordPress