Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Content Management System (http://www.go4expert.com/articles/cms/)
-   -   Add NoFollow Relationship to WordPress Blogroll (http://www.go4expert.com/articles/add-nofollow-relationship-wordpress-t7265/)

shabbir 12Nov2007 19:51

Add NoFollow Relationship to WordPress Blogroll
 
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.

coderzone 21Nov2007 09:41

Re: Add NoFollow Relationship to WordPress Blogroll
 
Good. Should add that on my blog

ralent 5Dec2007 19:48

Re: Add NoFollow Relationship to WordPress Blogroll
 
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.

shabbir 5Dec2007 22:21

Re: Add NoFollow Relationship to WordPress Blogroll
 
That can be told by wordpress guys only but in 2.2.2 its there.

rapwaydown 7Dec2007 01:29

Re: Add NoFollow Relationship to WordPress Blogroll
 
does that work on blogger

shabbir 7Dec2007 09:05

Re: Add NoFollow Relationship to WordPress Blogroll
 
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.

William9 28Jan2011 23:53

Re: Add NoFollow Relationship to WordPress Blogroll
 
Quote:

Originally Posted by shabbir (Post 21504)
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 :nonod: 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.

etiergjt 21Mar2011 09:14

Re: Add NoFollow Relationship to WordPress Blogroll
 
Quote:

Originally Posted by rapwaydown (Post 21493)
does that work on blogger

He is talking about WORDPRESS blogroll?Okay?

sandyofmalay 7Aug2011 01:03

Re: Add NoFollow Relationship to WordPress Blogroll
 
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

roars1111 5Sep2012 15:13

Re: Add NoFollow Relationship to WordPress Blogroll
 
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.

shabbir 5Sep2012 18:14

Re: Add NoFollow Relationship to WordPress Blogroll
 
Editing WP Core files never makes sense and your changes would vanish when upgraded or you may not be able to upgrade or else you may need to make those changes after every upgrade.


All times are GMT +5.5. The time now is 13:24.