Support » Fixing WordPress » Arrgh! No-follow inserted on Links in Comments!

  • I am trying to insert a link to an mp3 IN MY OWN BLOG! (in a comment)

    But as I save the hyperlink, WP automatically inserts a “no-follow”. How do I turn this behaviour OFF?

    I don’t like this functionality one bit!

Viewing 5 replies - 1 through 5 (of 5 total)
  • there is a plugin for that:
    http://wordpress.org/extend/plugins/

    The nofollow is automatically inserted on all comments, regardless of who makes them.

    To disable this for all comments, add this to your theme’s functions.php file:
    remove_filter('pre_comment_content', 'wp_rel_nofollow');

    If you only want to turn it off for, say, logged in users, do this instead:
    if ( $user_ID ) remove_filter('pre_comment_content', 'wp_rel_nofollow');

    Thanks for the tips both of you!

    Unfortunately I can’t FIND the plugin (checked all in the Comments section in Plugins)

    I can’t get the code to work. My theme did not have functions.php, but I created one. I added this:

    <?php remove_filter(‘pre_comment_content’, ‘wp_rel_nofollow’);?>

    No joy, although I am sure the functions.php was picked up by WP. Not sure what I am doing wrong?

    Please would you help me to explain how to add the code, or help me with a link to the plugin if it still exists?

    Thanks again!
    Cordelia

    You have to re-publish for it to take effect, I believe. Changing it doesn’t affect already-exisiting no-follow references. You’ll need to go in and take it out of the comment yourself and republish it.

    Yeah, that doesn’t edit existing comments for you. The pre-comment-content edits it before it saves it to the database. Adding that line will just prevent it from being added to future comments.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Arrgh! No-follow inserted on Links in Comments!’ is closed to new replies.