jcrens8392 (@jcrens8392)

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • In reply to: Add nofollow to links

    jcrens8392
    Member

    @jcrens8392

    Better yet, nofollow should be the default rel attribute value. From an SEO standpoint, you’re asking for trouble allowing dofollow links unless you really feel like checking out every single users’ website and making sure it’s not a “bad neighborhood”. Even then, Google will see you as handing out links indiscriminately and will probably take away any pagerank your pages might have had.

    In reply to: Add nofollow to links

    jcrens8392
    Member

    @jcrens8392

    I know this post is rather old, but none of the above suggestions worked. The problem with using the post_author_link or even get_user_link filters is that those only filter the “href” attribute, not the entire “a” tag. That means you can’t add rel=”nofollow” using those filters.

    I wasn’t able to figure out a way to get it done without editing the core. I suggest the post_author_link() function around line 1747 of bb-includes/functions.bb-template.php be edited to allow the option of only returning the link rather than echoing it. That way, you can output the author links in your template (post.php) using something like this:

    <?php bb_rel_nofollow(post_author_link(false)); ?>

    With the “false” parameter telling WordPress to return the link rather than echo it. I believe that would work for future releases.

    As for now, I believe you’ll have to open bb-includes/function.bb-template.php and edit the post_author_link and post_author_avatar_link functions to add rel=”nofollow” to the “a” tags. Those functions begin around line 1747 of bb-includes/function.bb-template.php.

    Hope that helps.

Viewing 2 replies - 1 through 2 (of 2 total)