When Google announced the nofollow attribute, they said that it should remove the motive for comment spamming.
A nobel ideal – however, Google failed to roll it out in a recent overhaul of the comment system in Blogger.
WordPress have included it as the default action in the latest version of WordPress but they haven’t included a switch or toggle to turn it off.
I found the code to be altered to be in wp-includes/comment-functions.php on line 173.
Simply change
rel='external nofollow'
to
rel='external'
and save if you don’t want nofollow on your commenter’s links.
In my case, I’m happy to have nofollow off as I am very vigilant about spam (I custom write my .htaccess file I have wp-hashCash installed and I moderate comments so no spam is ever published on my site).
And I’m not sure I trust Google and how they are implementing the nofollow tag.
UPDATE:
pericat contacted me to say that to completely get rid of all references to the nofollow attribute from WordPress, there are other changes to be made as well.
In the file default-filters.php, delete line 29 –
add_filter('pre_comment_content', 'wp_rel_nofollow', 15);
and in functions-formatting.php you need to delete lines 490-494:
function wp_rel_nofollow( $text ) {
$text = preg_replace('||i', '', $text);
return $text;
}
and you also need to delete from the make_clickable function on lines 482-489, the code rel='nofollow' – there’s a leading space in front of the rel
Comments
17 responses to “How to turn off the nofollow attribute in WordPress 1.5”
There appear to be three files with lines of code that affect adding ‘nofollow’ to links. (comment-functions.php, default-filters.php and functions-formatting.php). One of my to-do’s is to edit all of them. Today.
Well spotted pericat – when I deleted the nofollow attribute from comment-functions.php, the nofollow attribute disappeared from links to commenters’ sites.
Checking the files you mention, I did indeed find references to nofollow. I deleted lines 490-494 from functions-formatting.php and line 29 from default-filters.php.
There are still nofollow references in functions-formatting.php in the make_clickable function (lines 482-488) but I’m not sure how to safely remove these.
Thanks,
Tom.
Just got done. For that last file, in the make_clickable function, remove this from both lines:
rel='nofollow'(That’s a leading space in front of ‘rel’.)
Now, off to sort out why and when and how WP flags comments as ‘spam’. Seems to be a new classification.
I find it a shame it is so hard to take it off :/
Couldn’t a plugin be made for that ?
Sunny: there is a plugin: use DoFollow to turn rel=nofollow off.
As I just commented in another blog the plugin has the ability to limit display of nofollow-links to only the first N days, which is pretty nice in case something slips through your filter and you can’t care about your blog daily.
Thanks a lot g! Excellent plugin, that’ll make me happy for the rest of the day 😀
nofollow aus WordPress entfernen
Im Januar 2005 k√ºndigte Google an, zusammen mit MSN und Yahoo ein neues Attribut f√ºr die Kennzeichnung von Links einzuf√ºhren. Das neue “nofollow”-Attribut soll bewirken dass
die so gekennzeichneten Links von Suchmaschinen-Spidern nicht verfo…
You can also use plugin to strip nofollow from WordPress 1.5. Its a zero-configuration plugin. All it does is strip nofollow from comments and comment author url’s in the most efficient way possible without modifying any WordPress code.
You’ve Got Spam
Well, it had to happen. I just was surprised how quickly it came. I had about 5 comments on the Dogberry Patch today that looked like gibberish except that buried in them were links to some poker site. I hastily deleted the comments then went lookin…
WordPress 1.5.1
Hm, WordPress 1.5.1 ist verfügbar… ich bin mir allerdings noch nicht sicher, ob ich es schon installieren soll, außerdem will ich noch immer noch nicht das nofollow-tag und ich muß erst sehen, wie ich es hier rausgebaut habe und ob das bei der 1.5.1 …
[…] ves this plugin the potential to be dozens of plugins all rolled into one. DoFollow After hacking the WordPress rel=NoFollow code I saw this plugin – m […]
[…] ves this plugin the potential to be dozens of plugins all rolled into one. DoFollow After hacking the WordPress rel=NoFollow code I saw this plugin – m […]
The ethics and practices of using nofollow on your site
I was reading one of my favorite blogs ProBlogger (one of the best resources for learning how to make…
[…] For wordpress, you can use this pluggin called dofollow or follow this code for wordpress 1.5. For blogger, it seems that it is built in for comments, I am not sure for trackbacks, but it doesn’t appear to be able to be removed or turned off. For Moveable Type I am not sure the nofollow pluggin can be turned off or even not installed but there is other alternatives to combating comment spam, just Google it. Technorati Tags: Blog, blog etiquette, blogging, google, Miscellaneous, no follow, nofollow, search, Spam, weblogs, wordpress, Writing Blog Content […]
Thank you so much, I have been looking for a tutorial like that. Its ridiculous that this can’t be turned off with just an option in wordpress. A blogger should have total control over their work.
I’ve left a number of comments on WordPress blogs that I find as inbound links. I’ve been researching this because it makes no sense.
Seems one is given credit for the link even if the link contains rel=’external nofollow’.
This is interesting. I’m sure spam is a problem however giving a link is an incentive to posters. Or so I would think.
I was thinking about starting a blog about flash design but it seems to be so problematic that it’s almost to much work to do. I don’t know how to do write the special htaccess files. Is there somewhere I can download some tutorials.