WordPress Blogroll SEO “Gray” Hack
Written by Zain on October 26th, 2007{ 20 comments }
Do you need a hack for your blogroll to be able to control to your blogroll and add a “nofollow” attribute to it? Don’t have time to scour the WP Plugin resources to find something which does this? I’m going to admit - I didn’t have time to check if there is a plugin but thought this is a nice tip anyway just to demonstrate how you can get some more control over your WordPress system if you know how.
And I do…
I call this the “WP Blogroll Gray Hack”, named after the Stomper who first showed me it. Gray H, you know who you are - thanks for this little tip. I owe you a beer.
The method I’m going to demonstrate has actually been slightly updated as the original meant losing some of the other XFN options. This version actually adds more to the existing hack and provides a new checkbox to easily add the nofollow attribute.
Here’s the quick how-to guide for WordPress newbies on how you can do this.
The file we’re going to be hacking today is:
/wp-admin/edit-link-form.php
Before we get started, BACK UP YOUR FILE.
Okay, now for step-by-step guide on the Gray Hack:
- Open the edit-link-form.php file (yes, I’m making this very easy for newbies and the hard of thinking!)
- On around line 28, find the part that says:
if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
- Leave this code alone.
- Just above the code, add:
if ('seo' == $class && strpos($link_rel, 'nofollow') === false) echo ' checked="checked"';
- Scroll down and find the line which says:
<th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th?>
- Just underneath this line of code, find the opening table:
<table cellpadding="3" cellspacing="5">
- Add the following code just underneath this opening table tag.
<tr>
<th scope="row"> <?php _e('seo') ?> </th>
<td>
<label for="nofollow">
<input class="valinp" type="checkbox" name="seo" value="nofollow" id="nofollow" <?php xfn_check('seo', 'nofollow'); ?> />
<?php _e('nofollow') ?></label>
</td>
</tr>
- Save the file.
Now, when you go into the admin section and go to Blogroll / Add Link, you’ll now find a neat little checkbox that looks like this:
All you need to do is to click on the “nofollow” checkbox when adding or editing your Blogroll links and your links will then become nofollowed!
Caveats:
The hack works on my system just fine - if it doesn’t work on yours, then check the instructions again and make sure you are reading them properly.
Knowledge Constructs accepts no responsibility for any data loss, corruption to your website, loss of libido or permanent mental or physical damage cause by trying out this hack.
In the words of Spiderman’s uncle: “With great power comes great responsibility” - use the hack wisely otherwise Karma might come back and bite you in the ass.
Finally, updating your WordPress site will *KILL* this hack as WP will overwrite the edit-link-form.php file. We are working on a solution to this and may well build an SEO friendly blogroll plugin. If there’s enough interest, that is… ![]()
Tags: blogroll gray hack, blogroll hack, blogroll seo, gray hack, how-to guide, link hack, links, nofollow, search engine optimization, SEO, tip, WordPress, wordpress blogroll










October 26th, 2007 at 7:00 pm
[...] Zain wrote a fantastic post today on “WordPress Blogroll SEO â [...]
November 6th, 2007 at 10:03 am
[...] : a great solution can be found here, it requires a file edit, but still it’s worth it. linky : WordPress Blogroll SEO Nofollow Hack Blog Archive Knowledge Constructs __________________ my sites :irish jobs / irish online forum / irish job advice forum/ jobs in [...]
November 6th, 2007 at 10:10 am
great stuff ! I’ve implemented this on my site now.
Thanks,
B
November 10th, 2007 at 7:00 pm
Hello,
we are looking for a company to handle our word press theme and plugins for a word press ecommerce site and want to know if you would possibly be interested. Please contact me at jaredesguerra@gmail.com to talk in further detail. Thank you
November 23rd, 2007 at 6:21 pm
Hey guys increase Sales by 30% with Travel—-Do you want a free vacation
November 30th, 2007 at 11:22 pm
[...] Sometimes you link to a site and you want a NoFollow tag on that link. If you do, this page explains how to hack Wordpress so you have that option in your Blogroll: WordPress Blogroll SEO Nofollow Hack [...]
December 6th, 2007 at 4:45 am
Works great on my 2.3.1 WordPress. Only thing different was on item #5
>
my existing code did not have the ? and I left it as is.
>/th>
January 27th, 2008 at 1:58 am
Why would you want a NoFollow tag on a link? What does it have to do with SEO? Yes, I am new to all this stuff.
March 5th, 2008 at 7:14 pm
If you don’t want to hack core files, I wrote a simple plugin that adds nofollow to all blogroll links at http://jmoz.co.uk/blog/wordpress-blogroll-nofollow-plugin/8
March 11th, 2008 at 10:20 am
Lovely information mate.We can hack the plugin instead of using an additional plugin.Also i like the way you interpreted the information.Very easy to understand for a newbie user also.
Regards,
Sam.
March 12th, 2008 at 10:12 am
[...] So enjoy optimising the website for SEO and ready to get ranked higher into search engines.Article taken from Knowledge Constructs Website. [...]
March 30th, 2008 at 10:55 am
any idea where this is in version 2.5 of Wordpress ?
Thanks
April 3rd, 2008 at 10:34 am
[...] I did a while back called “WordPress Blogroll SEO Gray Hack ” where I explained how to search engine optimize (SEO) your WordPress blogroll and control the amount Page Rank juice flowing out of your external [...]
April 10th, 2008 at 10:04 pm
how to nofollow hack
May 6th, 2008 at 2:43 pm
thanks
May 6th, 2008 at 2:54 pm
thanks so much
May 6th, 2008 at 3:03 pm
WordPress Blogroll SEO Nofollow Hack
May 20th, 2008 at 2:20 pm
Dude, I’m headed off to try this right now! This is exactly what I was looking for!! Thanks!
June 16th, 2008 at 4:38 pm
great great great post! thanks very much for your guide.i am doing now.
July 1st, 2008 at 10:12 pm
Mesajiniz icin tesekkurler bana cok faydali bir bilgi oldu saolun