Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to disable the member (directory) page?


  • r083r7
    Participant

    @r083r7

    Hi,
    I’m trying to disable the members page that displays a directory of all BP members. Specifically I’m trying to disable the page not just hide it. I don’t want anyone to be able to guess the url or some other way access this page to view all members on the site.

    I found this https://buddypress.org/support/topic/disable-member-directory/ but the code didn’t work.

    Any other ideas?

Viewing 2 replies - 1 through 2 (of 2 total)

  • danbp
    Moderator

    @danbp

    Hi,

    “member” is a core component of BuddyPress and can’t be disabled. You need the “member” slug (or what ever you may use as custom slug) in the wp environment, for example to fire profiles, messages and so on.

    You want to obfuscate or forbid the member directory. That’s ok. Let’s make it simple and stupid! One possibility would be to add a restriction on the directory template. For example, you could allow only the site admin to access that part. Other roles will get a message instead (or nothing at all, or a redirection…).

    If i’m right, the directory template is in bp-legacy/buddypress/members/index.php
    Condition you could use:

     if ( !is_super_admin() ) {
     echo 'This page is not public';
    } else {
    // here the template content
    }

    To use this solution you need to use a child theme.
    There are many other ways to accomplish what you want. Here the most simple(imo), but you can go to overcomplicated and very sophisticated too.


    r083r7
    Participant

    @r083r7

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar