bbPress: Stop Search Engines Indexing Forum Profiles
Adds noindex to bbPress user profile pages, which are thin, duplicate content and a common target for spam sign-ups trying to get links indexed.
Opens WPIDE on
Code
if ( ! function_exists( 'bbp_is_single_user' ) ) {
return;
}
add_filter( 'wp_robots', function ( $robots ) {
if ( bbp_is_single_user() ) {
$robots['noindex'] = true;
$robots['follow'] = true;
}
return $robots;
} );
Notes
Forums and topics stay indexable.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.