Skip to:
Content
Pages
Categories
Search
Top
Bottom

Protecting Buddypress pages from non-logged in users.

  • Hi All,

    I want to protect all (if can choose from all then would be great) Buddypress pages from non logged in users.
    From all I mean anything associated with Buddypress like forums, activity page, members etc and also other pages which might be created on fly.

    From protection i mean the non-logged in users should not be able to see/browse the page even if they have the precise link to the page (only a logged in user should be able to see/browse it)

    I have found this plugin, but donot know if this can protect my BP pages too.
    http://wordpress.org/extend/plugins/private-post-by-default/

    and http://wordpress.org/extend/plugins/private-buddypress/
    but the private buddypress plugin seems like is no more supported and is compatible to WP 3.1 and BP 1.3

    Can some one please help or share some ideas?

    Thanks in Advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of giannisff
    giannisff
    Participant

    @giannisff

    Hi,
    I think that this link will help you. Have a look at this http://wpmu.org/how-to-build-a-facebook-style-members-only-wordpress-buddypress-site/

    Avatar of drill_sgt.lewis
    drill_sgt.lewis
    Participant

    @drill_sgtlewis

    Another simpler approach would be to created a bp-custom.php and place it in the plugins directory and add the following code
    `<?php
    function bp_guest_redirect() {
    global $bp;
    if ( bp_is_activity_component() || bp_is_groups_component() /*|| bbp_is_single_forum()*/ || bp_is_forums_component() || bp_is_blogs_component() || bp_is_page( BP_MEMBERS_SLUG ) ) {
    // enter the slug or component conditional here
    if(!is_user_logged_in()) { // not logged in user
    wp_redirect( get_option(‘siteurl’) . ‘/register’ );
    } // user will be redirect to any link to want
    }
    }
    add_filter(‘get_header’,'bp_guest_redirect’,1);
    ?>`
    This code will work to hide buddypress pages and group forums as is, if your using sitewide forums in line 4 remove the comments around:
    || bbp_is_single_forum()
    Save and refresh. Works in current versions.

    @giannisff I would definitely consider that solution.

    @drill your solutions works, only for the respective pages but what about the pages that are created on the fly .. for example when I tried to browse site_url/membsers/x/profile I get to see it.

    Any idea about this issue?

    Anyways thanks both of you for stopping by and replying :)

    Avatar of paintermommy
    paintermommy
    Participant

    @paintermommy

    I am interested in finding out the answer for this as well.

    Avatar of Chouf1
    Chouf1
    Participant

    @chouf1

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

You must be logged in to reply to this topic.