Wordpress: Remove nofollow From Comments


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /**
  2.  * Remove nofollow From Comments
  3.  * http://toscho.de/2009/no-no-no-nofollow/
  4.  *
  5.  **/
  6. function myfunction_dofollow($str) {
  7. $str = preg_replace(
  8. '~<a ([^>]*)\s*(["|\']{1}\w*)\s*nofollow([^>]*)>~U',
  9. '<a ${1}${2}${3}>', $str);
  10. return str_replace(array(' rel=""', " rel=''"), '', $str);
  11. }
  12. remove_filter('pre_comment_content', 'wp_rel_nofollow');
  13. add_filter ('get_comment_author_link', 'myfunction_dofollow');
  14. add_filter ('post_comments_link', 'myfunction_dofollow');
  15. add_filter ('comment_reply_link', 'myfunction_dofollow');
  16. add_filter ('comment_text', 'myfunction_dofollow');

URL: http://toscho.de/2009/no-no-no-nofollow/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.