WordPress Blogroll SEO “Gray” Hack

Written by Zain on October 26th, 2007
{ 40 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:

  1. Open the edit-link-form.php file (yes, I’m making this very easy for newbies and the hard of thinking!)
  2. On around line 28, find the part that says:

    if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
  3. Leave this code alone.
  4. Just above the code, add:

    if ('seo' == $class && strpos($link_rel, 'nofollow') === false) echo ' checked="checked"';
  5. Scroll down and find the line which says:

    <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th?>
  6. Just underneath this line of code, find the opening table:

    <table cellpadding="3" cellspacing="5">
  7. 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>
  8. 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:

wordpress-seo-gray-hack.png

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: , , , , , , , , , , , ,

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Bumpzee
  • Furl
  • Netscape
  • NewsVine
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati


40 Responses to “WordPress Blogroll SEO “Gray” Hack”

  1. Affiliate Freebies and Marketing Ideas » Blog Archive » WordPress Blogroll SEO “Gray” Hack Says:

    [...] Zain wrote a fantastic post today on “WordPress Blogroll SEO â [...]

  2. adding nofollow to blog roll links - Irish SEO, Marketing & Webmaster Discussion Says:

    [...] : 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 [...]

  3. PreBlogging (1 comments.) Says:

    great stuff ! I’ve implemented this on my site now.
    Thanks,
    B

  4. jared Says:

    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

  5. Amanda (1 comments.) Says:

    Hey guys increase Sales by 30% with Travel—-Do you want a free vacation

  6. How to Add a NoFollow Tag to Your WordPress Blogroll | eCommerce & SEO Says:

    [...] 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 [...]

  7. Rich Says:

    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>

  8. Joni Solis (2 comments.) Says:

    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.

  9. JMOZ (2 comments.) Says:

    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

  10. Samir Says:

    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.

  11. Wordpress Blogroll hack | Samir Kamble - Webmaster Resourses and Free Wordpress/Joomla Themes Says:

    [...] So enjoy optimising the website for SEO and ready to get ranked higher into search engines.Article taken from Knowledge Constructs Website. [...]

  12. ProBlogger (2 comments.) Says:

    any idea where this is in version 2.5 of Wordpress ?

    Thanks

  13. · Search Engine Optimize (SEO) WordPress 2.5 Blogroll | A How To Guide « KnowledgeConstructs.com Says:

    [...] 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 [...]

  14. oyun (1 comments.) Says:

    how to nofollow hack

  15. Kral oyun (1 comments.) Says:

    thanks

  16. Yemek tarifi (1 comments.) Says:

    thanks so much

  17. Emo resimleri (1 comments.) Says:

    WordPress Blogroll SEO Nofollow Hack

  18. Roy Malibu (1 comments.) Says:

    Dude, I’m headed off to try this right now! This is exactly what I was looking for!! Thanks!

  19. willy(new comment) Says:

    great great great post! thanks very much for your guide.i am doing now.

  20. Yemek Tarifleri(new comment) Says:

    Mesajiniz icin tesekkurler bana cok faydali bir bilgi oldu saolun :)

  21. full oyun(new comment) Says:

    nice thanks

  22. SEO Blogroll: Adding ‘nofollow’ Links to Wordpress Blogroll(new comment) Says:

    [...] hack was tested only on (Wordpress 2.5 or later) Original Source: Knowledge Constructs Finally, all future WordPress Updates will *KILL* this hack as WP will overwrite the [...]

  23. Ece(new comment) Says:

    Yemek tarifleri,resim,photo,funny

  24. Oyun Oyna(new comment) Says:

    thank you very…

  25. Mike(new comment) Says:

    Works great on 2.5 - not 2.5 +
    Mike

  26. The Brain Machine » Blog Archive » BlogRoll con il nofollow in WordPress(new comment) Says:

    [...] Sappiamo tutti la storia ormai, Google penalizza chi vende i famosi link testuali che spesso e volentieri per i blogger sono la principale fonte di reddito. Esiste un metodo di personalizazione del BlogrRoll che permette di aggiungere ai collegamenti il famoso tag nofollow in modo da evitare la penalizzazione, vediamo come fare (come consigliato da Knowledge Constructs). [...]

  27. Oyun(new comment) Says:

    very thanks..!

  28. Suro Agung(new comment) Says:

    excellent, very usefull tutorial

  29. Ebook Search Engine(new comment) Says:

    Search for thousands of paid ebooks

  30. StumbleUpon(new comment) Says:

    Thanks for the informative post.. and thanks for adding our comment to the blog. I am subscribing to your feed so I don\’t miss the next post!

  31. backlinks(new comment) Says:

    First of all congratulation for such a great site. I learned a lot reading article here today. I will make sure i visit this site once a day so i can learn more.

  32. Seo Pakistan(new comment) Says:

    SEO COMPANY

  33. Chat(new comment) Says:

    thanks you very nice site

  34. increase backlinks(new comment) Says:

    Backlinks are key to increasing your search engine popularity LinkPartnerExpress is the best on the web…I have 6500 links, all quality!!

  35. SEO India | SEM Services India(new comment) Says:

    Good Post, Keep it up…

  36. California Kid(new comment) Says:

    Thanks, work well

  37. kral oyun(new comment) Says:

    thank you

  38. oyun(new comment) Says:

    Thank you It’s very beautifully

  39. free home insurance quote(new comment) Says:

    Good Layout and Design. I like your blog. I just added your RSS feed to my Google News Reader. . :) :) :)

  40. 恶猫的博客(new comment) Says:

    好文章,这个这个…想转载一下不知道可以不?嘿嘿302


Leave a Reply