BuddyDev

Search

Hide members page

  • Participant
    Level: Enlightened
    Posts: 28
    Alison on #41394

    Hello,

    I would like to hide the members page to all my members. In other words, I don’t want members to be able to access the member directory. On the other hand, on a group if they click on a profile they can have access to the profile. How can I do that ?

    Thank you

    Cordially

  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41399

    Hi,
    You Could Install Plugin From Here- https://github.com/cromacio07/disable-bp-members-directory/raw/main/disable-bp-members-directory.zip
    It Will Redirect Anyone Except the Site Admin to your 404 Error Page, when They Try to Visit Members Directory.
    Also, Remove The Members Menu on Frontend from Your Dashboard.

    Regards,
    Cromacio

  • Participant
    Level: Enlightened
    Posts: 28
    Alison on #41400

    Hello,

    Is that an official plugin ?

    Cordially

  • Participant
    Level: Enlightened
    Posts: 83
    Princy Cromacio on #41418

    Hi Alison,
    This Isn’t an Official BuddyDev Plugin, But Has Code just From BuddyDev’s Post.
    You can Even Add the Following Code to Functions.php Yourself.
    function

    buddydev_hide_members_directory_for_all_except_admin() {
        if ( bp_is_members_directory() && ! is_super_admin() ) {
            bp_do_404();
            load_template( get_404_template() );
            exit( 0 );
        }
    }
     
    add_action( 'bp_template_redirect', 'buddydev_hide_members_directory_for_all_except_admin' );

    Here is a Link to Post by Brajesh Regarding this- https://buddydev.com/hide-buddypress-members-directory/

    Hope that Helps 🙂
    Cromacio

You must be logged in to reply to this topic.

This topic is: not resolved