WordPress.org

Ready to get started?Download WordPress

Forums

Arrgh! No-follow inserted on Links in Comments! (6 posts)

  1. vikingprincess
    Member
    Posted 7 years ago #

    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!

  2. PozHonks
    Member
    Posted 7 years ago #

    there is a plugin for that:
    http://wordpress.org/extend/plugins/

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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');

  4. vikingprincess
    Member
    Posted 7 years ago #

    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

  5. Doodlebee
    Member
    Posted 7 years ago #

    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.

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic