Forums

No Following the_tags Without Hacking Core Files (2 posts)

  1. jessekanclerz
    Member
    Posted 2 years ago #

    Hi,

    Is it possible to add nofollow to links created by the_tags without editing the core files?

    I tried adding the following to functions.php:

    function szub_nofollow_tag($text) {
    return str_replace('<a href=', '<a rel="nofollow" href=', $text);
    }
    add_filter('the_tags', 'szub_nofollow_tag');

    But it doesn't work, I'm assuming because this template tag adds in rel="tag" by default.

    Does anyone have a solution to this?

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    "Roll your own" links using Template_Tags/get_the_tags

Topic Closed

This topic has been closed to new replies.

About this Topic