Another Ways Remove all nofollow attributes from comments


Sponsored Links






I has written some tutorial How To Remove nofollow on Comments Text. Today tricks I will give another ways to do it, with more complex code and of course better code than before.

Remove all nofollow attributes from comments - Candice Swanepoel

Remove all nofollow attributes from comments - Candice Swanepoel

The ways to do this is simple as before, only write this code on your functions.php theme files and your are done. So let’s get started it.

// remove nofollow from comments
function do_dofollow($str) {
	$str = preg_replace(
		'~<a ([^>]*)s*(["|']{1}w*)s*nofollow([^>]*)>~U',
		'<a ${1}${2}${3}>', $str);
	return str_replace(array(' rel=""', " rel=''"), '', $str);
}
remove_filter('pre_comment_content',     'wp_rel_nofollow');
add_filter   ('get_comment_author_link', 'do_dofollow');
add_filter   ('post_comments_link',      'do_dofollow');
add_filter   ('comment_reply_link',      'do_dofollow');
add_filter   ('comment_text',            'do_dofollow');

And done, this code will do automatically the rest. Go to sleep and your WordPress site supported do follow comment because That code will remove all instances of the nefarious “nofollow” attribute from all comment items, including the author link and comment text. This is a great way to automatically remove nofollow with no plugins or hacking required.

Thanks for Thomas Scholz and Digging Into WordPress Authors to share this code

Photos courtesy egotstic

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

Remove nofollow attributes from comment text

WordPress added nofollow attributes on comment text url, this is bad for some commeter that needed some backlinks, if you want remove nofollow attributes from comment text in your WordPress site is easely, all need to do just added some … Read More

WP Tutorial: Remove admin name in comments class

Batovasan, create nicely WordPress Tutorial. The reason create this tutorial is Small Security Hole on WordPress. Like we all know by default, when the blog admin left a comment on his blog, WordPress use the name in the comment css … Read More

How To Delete All WordPress Spam Comments Using phpMyAdmin

I have website that attacker more than 2000 spam each days. And I am so unhappy with it. I know I haven't installed any Comment Preventing system.  The WordPress spam comment attack is pretty smart because it is definitely automated … Read More

The Right Way Highlight Author Comments in WordPress

This Tricks original written by AEXT.net and we only share and to make it more clearly, especially for me. How To Highlight Author Comments in WordPress in the right way. This code is better for the future and better for … Read More

How to remove admin bar WordPress 3.1

Some people feels admin bar from WordPress 3.1 quite disturbing. I think its cool feature but if you want to remove this function, here it is some alternative that I’ve collected from this blog. Copy this code below and paste … Read More

Replace Content on Your WordPress using SQL

Like we all know, we can use SQL to replace or remove some content in our WordPress using phpMyAdmin, on this post I will show you How To Replace/Remove Content on Your WordPress using SQL. On this trick you can … Read More

Another Ways Remove all nofollow attributes from comments

Comprehensive Reference for WordPress NoNofollow/Dofollow Plugins. completely removes all nofollow attributes from WordPress comments. long comment links and remove read more

Source: http://wptricks.net/another-ways-remove-all-nofollow-attributes-from-comments/

malayalamstory - WordPress Tricks & Tips

Another Ways Remove all nofollow attributes from comments April 17th, 2010 By WP Tricks Posted in Tricks read more

Source: http://wptricks.net/archives/sexmalayalamstory

WordPress Tip: Remove nofollow Attributes from Post Content

things up and remove all nofollow attributes from by including another add_filter function: function remove_nofollow will remove the nofollow attribute from comments. read more

Source: http://digwp.com/2010/02/remove-nofollow-attributes-from-post-content/

Hacking WordPress: Nofollow Blacklist for Commentator Links

they change their mindless ways. Simply put, a nofollow dofollow plugins available to remove the trecherous nofollow attributes Subscribe to comments Notify me of read more

Source: http://perishablepress.com/press/2007/09/12/hacking-wordpress-nofollow-blacklist-for-commentator-links/

WordPress Custom functions.php Template, Part 2 | Digging into

In this post, we deliver another prime collection of Remove all nofollow attributes from comments. There are a million ways to remove nofollow from your comments, but read more

Source: http://digwp.com/2010/04/wordpress-custom-functions-php-template-part-2/


5 Responses to Another Ways Remove all nofollow attributes from comments

  1. Pingback: Tweets that mention Tutorial Remove all nofollow attributes from comments # WordPress Tricks & Tips -- Topsy.com

  2. Pingback: WordPress for Android | Unlock IMEI Cellphones

  3. Iurie says:

    Sorry, if I am wrong, but I think you have a mistake on row 4. I think it should look like this: ’~]*)s*(["|"]{1}w*)s*nofollow([^>]*)>~U’,.
    And a question about row 6: Is a difference between ’ rel=”"‘ and ” rel=””?

    Regards, Iurie

  4. Iurie says:

    Sorry, if I am wrong, but I think you have a mistake on row 4. I think it should look like this:
    ’~]*)s*(["|"]{1}w*)s*nofollow([^>]*)>~U’,.

    And a question about row 6: Is any difference between
    ’ rel=”"‘ and ” rel=””?

    Regards, Iurie

  5. Iurie says:

    Sorry for repeated comments.
    I apologize for repeating the comments. I wanted to make them look better but I failed. A preview would have been welcome.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>