WP Biographia
[resolved] NoFollow links on Author description (3 posts)

  1. Sk Nepal
    Posted 3 years ago #


    Is it possible to make the links on description as no-follow? (Not the contact links, but the ones on bio-description).

    str_replace('href','rel="nofollow" href', $the_author_description);

    In my theme's inbuilt author box, I had used the above code to replace href with href rel="nofollow" on author description links. When a user viewed his profile through WordPress dashboard, the nofollow attribute won't show up there, it will only be added to the author bio links when a post was loaded. How can I do so with the plugin?

    Please let me know.

    Thank you.


  2. vicchi
    Plugin Author

    Posted 3 years ago #


    This is outside of the scope of WP Biographia but you should be able to achieve this via the get_the_author_description filter by adding something along the lines of the following to your theme's functions.php ...

    add_filter (get_the_author_description, bio_nofollow_links, 10, 2);
    function bio_nofollow_links ($content, $user_id) {
    	str_replace ('href','rel="nofollow" href', $content);
    	return $content;

    A couple of points to note ...

    There's a filter for any of the parameters you can pass to either the_author_meta() or get_the_author_meta(), not just the description (bio) from the user's profile. See /wp-includes/author-template.php at line 112 in WP 3.4.2.

    I've not tested this, so it's advisable to try this out on a local installation or one that isn't your live site. It may need some tweaking.


  3. vicchi
    Plugin Author

    Posted 3 years ago #

    Haven't heard back from you on this, so I'm making the assumption it's all working for you. Feel free to re-open this thread if that's not the case.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Biographia
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic