Removing nofollow from WordPress 1.5
As part of a Google initiative to combat spam, a new bit of coding was introduced to all of the developers of major blogging platforms. They gave their backing, and have started automatically implementing it into their scripts. I'm talking about rel="nofollow" — which is apparently a miracle cure for cutting spam.
It's supposedly going to work on the basis that any link with rel="nofollow" as a property won't be indexed by the Google bots and therefore will receive less (or no) hits from the Google search engine. This sounds great; the only flaw being that spammers don't rely on their listing in a search engine — they rely on clicks. Spammers and spam bots will not check weblogs to see if rel="nofollow" has been implemented, therefore completely defeating the point of adding it.
The only thing rel="nofollow" will achieve is breaking the link circle for genuine commenters on weblogs who require faultless click-throughs and search engines to boost their traffic and find new friends. The purpose of the Internet is to find information, and if that information is not listed at search engines because of badly implemented rel="nofollow" — there's no point in the pages existing.
If, like me, you are against rel="nofollow" and are annoyed that WordPress developers have implemented it as standard in version 1.5, you can remove it by doing the following:
- Open the file comment-functions.php in the wp-includes directory.
- Search for
$return = "<a href='$url' rel='external nofollow'>$author</a>";. - This can usually be found on line 173 (word wrap off).
- Change
<a href='$url' rel='external nofollow'>to<a href='$url'>. - Save the document.
- Open the file default-filters.php (wp-includes directory again).
- Find
add_filter('pre_comment_content', 'wp_rel_nofollow', 15);(line 29) - Remove the entire line & save the document.
- Open the file functions-formatting.php (wp-includes directory again).
- Find
<a href='$2://$3' rel='nofollow'>$2://$3</a>(line 484) - Remove
rel='nofollow'(including the leading space). - Find
<a href='http://www.$2.$3$4' rel='nofollow'>(line 485) - Remove
rel='nofollow'(including the space) & save the document. - Find
function wp_rel_nofollow( $text ) {(line 491) and remove the function. - The function is four lines long, and ends in
}. - Upload the edited files into the correct directories.
Please note: this method has only been tested in WordPress 1.5.
Tags:
wordpress, nofollow,
Last Updated On: 23rd February 06 by Jem
Bookmark At: StumbleUpon, Digg

Handy Stuff
Downloads
Top Links
Resources