Adding nofollow attribute to your WordPress blogroll

If you want to add the “nofollow” attribute to any link in your blogroll (and you should do this if your links come from paid sources or if you want to limit the flow of pagerank) without using a plugin here’s quick tutorial as to how you can add this attribute to your WordPress installation (WordPress 2.9+).

Note: If you use a version older than WordPress 2.9 this method will not work. Check this website for a method that works with older installs, or upgrade to the latest version.

Warning: before you start please make a backup of the files that you’re going to edit.

How to add nofollow to WordPress Blog links

If you’re a beginner you’ll get your hands a little dirty but it’s not so hard afterall, you’ll see.

1. Navigate to your wordpress install folder and open the file /wp-admin/includes/meta-boxes.php.
2. Go to line 675 and you should see somethink like this:

<tr>
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('identity') ?> </th>

3. Now, just before this line add this piece of code:

<tr>
<th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('Seo') ?> </th>
<td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('nofollow') ?> </span></legend>
<label for="nofollow">
<input class="valinp" type="checkbox" name="nofollow" value="nofollow" id="nofollow" <?php xfn_check('Seo', 'nofollow'); ?> />
<?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('nofollow') ?></label>
</fieldset></td>
</tr>

Save your file and go to the Links section from your WordPress Dashboard. If you edit or add a new link, you’ll see that the “Seo” option with the “nofollow” attribute is the first attribute in the Link Relationships (XFN) section.

Hope you’ve enjoyed this. Cheers.

Thumbnail from here.