Add NoFollow Relationship to WordPress Blogroll

shabbir's Avatar author of Add NoFollow Relationship to WordPress Blogroll
This is an article on Add NoFollow Relationship to WordPress Blogroll in Content Management System.
These days Google has been penalizing (by decreasing the pagerank) sites for placing links to other sites with rel="nofollow" tags. The step taken by Google is for flagging those sites for a main reason that they are playing with the Google search ranking algorithm and Google wants its algorithm to be as full proof as possible.

Blogroll in WordPress displays a list of blogger’s favorite blogs in the sidebar of their blog home page. Now Word press BlogRoll does not have the option of adding the rel="nofollow" tags for sites in the Blogroll but has lots of other option for XFN (XHTML Friends Network) and for my blog the case was that I link to lots of my friends blog and nothing related to link exchange or selling links.

I wanted to add the rel="nofollow" tag but not for all the links because I would also like to have the XFN option open.

So here is how you should be doing that.

We need to hack through WordPress core source code file. Go to wp-includes/ directory of your blog root folder, then edit the bookmark-template.php file

Find
PHP Code:
if ( '' != $rel )
    
$rel ' rel="' $rel '"'
Replace with
PHP Code:
if ( '' != $rel )
    
$rel ' rel="' $rel '"';
else
    
$rel ' rel="nofollow"'
You need to do that at two places. One in _walk_bookmarks function and other in get_links functions.
0
coderzone's Avatar, Join Date: Jul 2004
Team Leader
Good. Should add that on my blog
0
ralent's Avatar, Join Date: Dec 2007
Newbie Member
Shabbir ... I see the code string in _walk_bookmarks on my bookmark-template.php file but I can not find get_links.

I am running WordPress 2.3.1. Is it possible that the bookmark-template.php file has been changed with this version of WordPress.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
That can be told by wordpress guys only but in 2.2.2 its there.
0
rapwaydown's Avatar
Contributor
does that work on blogger
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by rapwaydown
does that work on blogger
It should but the code may not be same. Blogger does not provide you the code as far as I know but I may be wrong.
0
William9's Avatar, Join Date: Feb 2010
Go4Expert Member
Quote:
Originally Posted by shabbir View Post
These days Google has been penalizing (by decreasing the pagerank) sites for placing links to other sites with rel="nofollow" tags. The step taken by Google is for flagging those sites for a main reason that they are playing with the Google search ranking algorithm and Google wants its algorithm to be as full proof as possible.
Now isn't this a strange behavior by Google. A website should not contain external links at all even with rel="nofollow" tags, whereas these links are useful for people and make things easy for search engine spiders as they are as a simple text for them.
0
etiergjt's Avatar
Light Poster
Quote:
Originally Posted by rapwaydown View Post
does that work on blogger
He is talking about WORDPRESS blogroll?Okay?
0
sandyofmalay's Avatar, Join Date: Aug 2011
Go4Expert Member
Searched for a solution to this myself, as far as I'm aware you can add the rel=nofollow tag to each link as you add them also. Suppose it's a weigh up whether you apply this based on how frequently you need to alternate or add links to the sidebar
0
roars1111's Avatar, Join Date: Sep 2012
Newbie Member
Warning:As with all editing of files, you should keep a backup of them before you start to change them. Believe me, it will save some headaches along the way.

Adding the nofollow and external attributes is quick, easy and painless, here are the 3 steps.

open file /wp-admin/edit-link-form.php
Go to line line 193 / 194 and find
<tr>
<th scope="row"> <?php _e('identity') ?> </th>
Above that add
<tr>
<th scope="row"> <?php _e('seo') ?> </th>
<td><fieldset><legend class="hidden"> <?php _e('seo') ?> </legend>
<label for="external">
<input class="valinp" type="checkbox" name="seo" value="external" id="external" <?php xfn_check('seo', 'external'); ?> />
<?php _e('external') ?></label>
<label for="nofollow">
<input class="valinp" type="checkbox" name="seo" value="nofollow" id="nofollow" <?php xfn_check('seo', 'nofollow'); ?> />
<?php _e('nofollow') ?></label>
</fieldset></td>
</tr>
Once you have this, go to Links on the side bar, and now you can change existing links or add new links with these attributes. There will now be an extra line in the Link Relationship section of your Links page.