Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide the MEMBERS, GROUPS, ACTIVITY pages

  • Profile photo of Dhyana
    Dhyana
    Participant

    @dhyana

    Hi,
    I checked to see if these pages are hidden behind the membership, and they are not.
    People can just type up mywebsite.com/members and they can see all my members. Not at all what I am trying to do.

    Where can I hide the MEMBERS page, the GROUPS page, the ACTIVITY page, and all the other (except for the REGISTER) pages, behind the membership options?

    Every one of these pages have the REQUIRE MEMBERSHIP enabled to view (and all my membership levels are checked), yet they are visible to the general public.

    And this is a VERY BIG PROBLEM.

    PLEASE HELP!
    THANK YOU!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Profile photo of Henry Wright
    Henry Wright
    Moderator

    @henrywright

    Hi @dhyana

    Put this in your theme’s functions.php file:

    function my_redirect_pages() {
        if ( ! is_user_logged_in() && ( is_page( 'members' ) || is_page( 'groups' ) || is_page( 'activity' ) ) ) {
            wp_redirect( home_url() );
            exit();
        }
    }
    add_action( 'template_redirect', 'my_redirect_pages' );

    This will block these pages for users not logged in. If you wanted to go one step further and limit access by membership then you’d need to modify the condition in the my_redirect_pages function slightly.

    Profile photo of wp_maybe
    wp_maybe
    Participant

    @wp_maybe

    Or you could try a plugin like: https://wordpress.org/plugins/private-bp-pages/

    Profile photo of Hugo
    Hugo
    Moderator

    @hnla

    behind the membership options?

    Every one of these pages have the REQUIRE MEMBERSHIP enabled to view (and all my membership levels are checked)

    You seem to be talking about some third party approach to membership here, if that’s the case you really do need to acknowledge that in the opening question so we know how to respond best, bear in mind that buddypress doesn’t have any default membership options as you describe them.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide the MEMBERS, GROUPS, ACTIVITY pages’ is closed to new replies.
Skip to toolbar