Hi,
There seem to be multiple pages on Google explaining this on how to set robots.txt, less on the noindex. But note that these are just guidelines for the indexers. The page is still accessible !
So why not going in protecting the profile for non logged-in users (an indexer is not logged-in!) ? You can check my ‘bbP Toolkit’ where I secure user profiles so they cannot be seen by non logged-in users.
Pascal.
Making member pages accessible for logged in users only is an interesting workaround. Thanks a lot for this idea.
Nevertheless I wonder if there is any option to add “noindex” as meta-tag to each member page instead of using robots.txt?
Any other idea? Any feedback is highly appreciated!
I found an answer that solves my question here:
Meta Title for Profile Pages w/ Yoast SEO
For those who want to noindex in particular the replies of all mebers just add
<META NAME=”ROBOTS” CONTENT=”NOINDEX, NOFOLLOW” />
to the “user-replies-created.php” in the folder
wordpress > wp-content > plugins > bbpress > templates > default > bbpress
Where does that code goes exactly?!! also wouldn’t you want to nonindex the “users subscriptions”, “favorites”, and “topics started” as well ??
Hello,
so what is the right way to noindex member pages?
thank you
I have now put this in robots.txt
Disallow: /users/
is that right?
hope anybody can help me..
If you are using SEO Yoast Plugin you can do the following to your functions.php to update the robots meta tags.
function noindex_profile($html) {
if (bbp_is_single_user()){
$html = "noindex,nofollow";
}
return $html;
}
add_action( 'wpseo_robots', 'noindex_profile' );
If you are not using any plugin or don’t see any robot tags to update in your userprofile, use the below instead and the insertion will be made in the head
function noindex_profile() {
if (bbp_is_single_user()){
echo '<META NAME=”ROBOTS” CONTENT=”NOINDEX, NOFOLLOW” />' ;
}
}
add_action( 'wp_head', 'noindex_profile' );
Hope this helps.
great – thanks for posting your solution 🙂
Hi,
I just did something similar for Rank Math SEO plugin:
/**
* Sets bbPress user profile pages to noindex
*
* @param array $robots The meta robots directives.
*/
add_filter( 'rank_math/frontend/robots', function( $robots ) {
if (!bbp_is_single_user_profile()) {
return $robots;
}
unset( $robots['index']);
$robots['noindex'] = 'noindex';
return $robots;
});
Cheers