Categories
Code WordPress

BuddyPress: Disable the Public Members Directory

The following code snippet can be used to disable access to the default BuddyPress Members Directory.  Simply add the following code to your theme’s functions.php file.

//Disable members directory
function disable_directory_members() {
 global $bp, $wp_query;
 $bp_is_directory = false;
 bp_core_redirect( $bp_root_domain );
}
add_action( 'bp_core_action_directory_members', 'disable_directory_members', 2 );

Update – 11/17/2011:  As of BuddyPress v1.5 this post this method is deprecated. You can now achieve this same result by unpublishing the ‘Members’ page from the ‘Pages menu in the admin area.