Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove Member Directory Without Profile Error


  • grimbot
    Participant

    @grimbot

    Hi, I am trying to remove the members directory. I don’t want users searchable or in a directory, but I want their profiles to work.

    When I remove the member directory, all links to go to peoples profile stop working.

    How can I remove the member directory without messing up the feature of allowing people to click on a members picture from a post, or by going directly to their member url?

    This question was also asked in a post 5 years ago but I don’t think it was ever resolved. Everything I tried on that page didn’t work.

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

  • danbp
    Participant

    @danbp

    Hi @grimbot,

    Members are the heart of BuddyPress. So it is important to understand that members are core and that anything related to them is quite “delicate” to handle.

    In your case, removing the member directory doesn’t mean to remove the page called members, because this page is BP territory and, like i said, it is core. If you remove it, you avoid BP to work.

    First thing you can do is to remove any access to this member page on your theme.
    Go to appearance > menu and uncheck “members” from the BP menu.


    grimbot
    Participant

    @grimbot

    I went to “apperance” and then “menues” structured a new menu that didn’t include the members directory, but when I go to a user profile, I can see in the url string it going through the members page, and then I remove the user name from the url, it takes me to a members directory.

    Did I remove access properly by not including it in a menu or is there something else I am not doing to stop people from browse/searching the users?


    shanebp
    Moderator

    @shanebp

    This function will redirect everyone, other than site administrators, to the home page when they try and access the members directory.
    Put it in bp-custom.php.

    function grim_members_directory() {
    
    	if ( bp_is_members_directory() && ! is_super_admin() )
    		bp_core_redirect( site_url() );
    	
    }
    add_action( 'bp_ready', 'grim_members_directory' );

    grimbot
    Participant

    @grimbot

    I get an error on the top of the page when I put this in the bp-custom.php. Maybe I’m installing it wrong? If my members directory page is simply named “members”, and when people try to access it they are to be redirected to http://www.google.com, would I fill it in like this, or does the member page need to be specified with the full page url?
    ————-

    function grim_members_directory(members) {
    
    	if ( bp_is_members_directory(members) && ! is_super_admin() )
    		bp_core_redirect( site_url(www.google.com) );
    	
    }
    add_action( 'bp_ready', 'grim_members_directory' );

    grimbot
    Participant

    @grimbot

    Hmm.. I’m confused. I tried filling it out 5 different ways and each way I get an error on the top of the page, I didn’t try logging in as a regular user to see if the redirect worked because the error at the top was enough of a sign to let me know something was messed up. I’m new to .php though, I’m more familiar with html. I’m probably missing something simple.

    Could you show in your example where I would put the “Google.com” redirect, and if the member directory page is labeled “MemberPage”, and if I need to add the whole url.


    shanebp
    Moderator

    @shanebp

    Try:
    bp_core_redirect( 'http://www.google.com' );


    grimbot
    Participant

    @grimbot

    I was able to get something working by editing, I think it was, the functions.php

    I thought I posted the code I used onto here but it didn’t seem to take. Should I try to reshare the code again or did I and it was removed?

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