Adding nofollow to Wordpress Links
Posted by thinkjim | Posted in blogging | Posted on 02-06-2008
4
There seems to be a big debate about the use of the rel=”nofollow” tag when linking to other websites. I’m no SEO expert – so I’m in no position to comment! but in this post I will tell you how I added a checkbox to wordpress admin that allows me to make new sidebar (blogroll) links nofollow links. In my case I opted to use nofollow for linking to a few big websites. I haven’t used nofollow for linking to smaller sites that need the juice.
What is the rel=”nofollow” tag?
Simply put the rel=”nofollow” tag can be used when linking to other web sites to tell google and other search engines not to follow that link as part of their crawl. Thats the oversimplified explanation anyway, the reality is that it tells google not to add any weight to that page’s pagerank / ranking because of your link to that site, which it might otherwise do.
How I added rel=”nofollow” to selected sidebar (blogroll) links
If I want to create a link on my sidebar I usually go to ‘write’ and then ‘links’ from with WP Admin. At the bottom of this page there is a subtitle – “Link Relationship (XFN)” and beneath it is a text entry field with the tantalising word ‘rel’ (hmmm I want rel=”nofollow”)…… Unfortunately WP 2.5 won’t let me type anything here. I have to tick a checkbox beneath the text field for anything to appear in it. I guess I need a tickbox called ‘nofollow’. How do I add that?
To do this I downloaded and edited the ‘edit-link-form.php’ file from the \wp-admin folder on my webserver. I inserted the following line of code:
<tr>
<th scope="row"> <?php _e('following') ?> </th>
<td>
<label for="follow">
<input class="valinp" type="checkbox" name="follow" value="nofollow"
id="nofollow" <?php xfn_check('follow', 'nofollow'); ?> />
<?php _e('nofollow') ?></label>
</td>
</tr>
this was inserted just above
<th scope="row"> <?php _e('identity') ?> </th>
which was on line 174 in my file. Now I have a tick box at the bottom of the write, links page and if I tick it, it makes the link a nofollow link!
** If you try this make sure you take a back up of edit-link-form.php first **



