Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Plugins
    In reply to: “nofollow” in posts

    If you don’t mind monkeying with code, you can do this:

    Open template-functions-post.php in the wp-includes folder and find this:

    function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    echo $content;
    }

    then add this line just before the last line of the function:

    $content = str_replace('<a href', '<a rel="nofollow" href', $content);

    so the function now looks like this:

    function the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    $content = str_replace('<a href', '<a rel="nofollow" href', $content);
    echo $content;
    }

    Seems to work just fine.

Viewing 1 replies (of 1 total)