Try the following in your functions.php
function commentdofollow($text) {
return str_replace('" rel="nofollow">', '">', $text);}
add_filter('comment_text', 'commentdofollow');
remove_filter('pre_comment_content', 'wp_rel_nofollow', 15);
function remove_nofollow($string){
return str_ireplace(' nofollow', '', $string);}
add_filter('get_comment_author_link', 'remove_nofollow');
Hope this helps.
SYA ??
LebCit
As said, we don’t need nor want to delete all nofollows, but instead to NOT have wp mess up linking on our site at all.
Ie when we reply a user with a link to an article that answers his question, Google & Co shall NOT be told by wp: “Hey bots, don’t follow these links to helpful pages, cause wp engineers ill-thought that NO ONE wants dofollow links these days”, lol!
WE WANT that our links are followed, that they stay clean, that wp does NOT interfere. Phew, it’s OUR CONTENT! It’s beyond me that 1) wp implemented this forced-upon nofollow, and 2) that (seemingly) no one raised their hand yet that they require dofollows at times.
]]>I wrote: “We simply need to do sth like this
remove_filter(‘comment_text’, ‘auto_nofollow’);”
See the one word difference?
I see that three times my post was “edited” by moderators, and in the cause of fairness, objectivity, and respect, I’d be grateful if mods don’t ALTER users’ posts according to their own “liking”.
(!)
Now, here’s the hack that works 100% correct (used it already), and sadly it has to be a wp “hack” until one of the wp programmers wakes up and realizes what a “facism” it is to auto-add “nofollow” to each and every comment link, even to those of the webadmin himself…
In wp-includes/default-filters.php, to NOT have wp add nofollow to comment links, but instead have wp LEAVE any admin entered nofollow as it is (and where the admin didn’t put one, LEAVE it out as well!), do this:
DELETE
add_filter( ‘pre_comment_content’, ‘wp_rel_nofollow’, 15 );
That’s it. Simple. Remember to have to redo it after “every” wp update.
Let’s all “pray” that the next wp update removes that automatic nofollow nonsense.
Then this “hack” can be removed from our installation as well. Yeah!
This is a piece of code you can insert in your functions file, so you won’t have to keep editing it when the automatic updates decides to mess up your default filter file again.
remove_filter( ‘pre_comment_content’, ‘wp_rel_nofollow’, 15 );
I have been trying to get it to work, but it doesn’t seem to for me.
however, you might have better luck.
]]>Allow me to add WHY wp has implemented the forced-upon nofollow and HOW to make that very reason OBSOLETE altogether:
– wp added that to mitigate the COMMENT SPAM floods that emerged at that time.
– BUT: the comment spam floods can SO EASILY BE AVOIDED in a MUCH BETTER WAY, and indeed with wp’s OWN features alone!
>>> For ages we’ve been using the following settings under “Discussion” and we have ZERO SPAM issues, despite floods of bots & people TRYING to post comment spam:
1) TICK “Allow people to post comments on new articles”
2) “Comment author must fill out name and email” (most people’s browser settings will fill that out automatically anyway upon revisit)
3) NO NEED to tick “Users must be registered and logged in to comment”, we can allow ANYONE trying to post spam, no problem! ??
4) TICK “Comment author must have a previously approved comment”
5) FILL IN “Hold a comment in the queue if it contains 1 [ONE!] or more links” [because we don’t want anyone to post links, right?! Spammers do that. While genuine site “fans” aren’t interested to market OTHER sites on OUR SITE…! Yet, you may still add a note above comment box that they may WRITE OUT a helpful URL “name only, no prefix, no suffix!”]
6) FILL IN “When a comment contains any of these words in its content, name, URL, email, or IP, it will be put in the trash. One word or IP per line”:
http
www
href=
hard to find your posts in google
*
{
|
wrinkles
serum
qf
background
[All these are typically used by spammers, experience shows. You may add more.]
THAT’S ALL YOU NEED in settings, to have ZERO SPAM POSTED to your site.
So now when you have a new “fan” to your site (quality comment) you’ll approve his first comment to be published on YOUR SITE, right?
And when a spammer or bot tries to post spam, it gets automatically into “Trash” or “Spam” (some 99.8% on our sites), and you trash the (rarely) new spam type and add that phrase to the above list. ??
>> Even if I forgot to mention a point(??), as said, this works SUPER RELIABLE to prevent ALL spam. Enjoy!
]]>Why reinforce the urgency today?
After wp’s most recent update (thank you again, I for one truly appreciate you always keep wp up-to-date)
… as a one-off I FORGOT to implement my hack into wp-includes/default-filters.php
… and promptly wp quietly behind the scenes added “nofollow” to every single admin’s comment!
Doesn’t anyone here, or in the wp programmers ivory tower(?), realize…
… how DESTRUCTIVE this if for SEO, if you can’t merely apply common sense?
Common sense tells us: When we put an internal link in our comment, to help users find their way on our site(!!!!), it is the utmost biggest stupidity to have wp quietly add “nofollow” to every link!
That is misdirected anarchy, not smart programming, guys. ??
Get rid of that. Now. You cannot truly want that every informed and thus upset wp user HACKS wp-includes/default-filters.php after EVERY update in order to get rid of that sickness, do you?
OMG!
]]>