In this tutorial, I’ll teach you how to insert rel=”nofollow” to your selected Blogroll links. You must be aware of the fact that WordPress Blogroll is a feature that lets you to show links of your favorite websites on your blog. This feature allows webmasters to link-exchange with other websites easily by showing Blogroll as a widget in sidebar or footer bar or any other hook.
The nofollow attribute in anchor tag <a> is a great SEO (Search Engine Optimization) technique. This should be used carefully only in those links which you don’t want search engines like Google, Yahoo, Bing etc. to follow. If you have several links of other websites in your pages then you should apply rel=”nofollow” to those external links. This step stops link juices to flow to those websites and make it available more for your own pages.
Unfortunately WordPress CMS (Content Management System) has no rel=”nofollow” option to exercise, while you are creating or editing a Blogroll link. This is very frustrating. But don’t worry. I’m going to tell you how to add rel=”nofollow” option while creating or editing a WordPress Blogroll Link.
How to apply rel=”nofollow” to Selected Blogroll Links only
Follow these steps carefully to create re=”nofollow” link relationship (XFN) in Blogroll Links. By default it is not there in WordPress CMS. See the screenshot below, to see what I’m talking about.
The solution is very easy and anyone can do it. Obey the following steps very carefully :
- Log into your website’s FTP account to access it and download the file meta-boxes.php present in wp-admin -> includes folder.
- Open the file meta-boxes.php file in your favorite text editor. In line number 865 (I’m using WordPress v3.4.1), look for the closing table tag i.e. </table> below it (i.e. in line number 866). Note that the line number can vary if you are using some other WordPress version.
- At line number 865 add the following code-block.
<tr> <th scope="row"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('nofollow') ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('nofollow') ?> </span></legend> <label for="nofo"> <input class="valinp" type="checkbox" name="nofo" value="nofollow" id="nofo" <?php xfn_check('nofo', 'nofollow'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('nofollow') ?> </label> </fieldset></td> </tr>
See the screenshot below for clear demonstration.
- Save the meta-boxes.php file.
- Upload the modified version into wp-admin -> includes folder by overwriting the older file.
- Now in your WordPress Control Panel go to Links -> All Links. Edit and save all the links with rel=”nofollow” option if you want.