I don’t know if there’s a good plugin for this but you can add a custom function to your bp-custom.php file that achieves the same result. You can read how to make a bp-custom.php file here in the BP Codex.
When your bp-custom.php file is ready, you add this function to the file:
<?php
function restrict_bp_pages() {
global $bp;
if( bp_is_blog_page() || bp_is_register_page() || bp_is_activation_page() ) {
return;
}
if( !is_user_logged_in() ) {
bp_core_redirect( $bp->root_domain .'/YOUR-LOGIN-SLUG' );
}
}
add_action( 'get_header', 'restrict_bp_pages' );
You insert the slug of your login page in the place of YOUR-LOGIN-SLUG
into the code above. E.g. if your login page is http://www.mypage.com/mylogin, your insert ‘/mylogin’. If you want to use your home page you leave out this part and only use bp_core_redirect( $bp->root_domain );
.
Then you upload the bp-custom.php file into the /wp-content/plugins/ folder on your server, and you’re ready.
Hey,
I’m pretty new to BP myself, started my site about two weeks ago. I use the Absolute Privacy plugin. You can lockdown the complete site or include a members area. What’s great about this plugin is that you can put the page ID of pages that you still want to visible to logged out users. So, for example, while logged out my users can still access the registration page, our about page, a history page and our terms and service. Other than that all other pages clicked on send them to the login page or whichever page you designate.
Important note: You need a plugin that will show you the page ID numbers for your pages. There’s someway to find it on WP but no one on the forums explained it in a way I could understand. I use Reveal IDs. Really simple install and the IDs show up right on your pages panel. Overall the Absolute Privacy plugin was worth the double download.
I hope this helps. If not, I think I have the names of some the other plugins I used but didn’t work for me. Maybe they might for you. Anyways, good luck!
To get a page ID, simply mouse over the page title on the page list and you can see it in the bottom left corner of your brower.
Someting like this:
../wp-admin/post.php?post=23&action=edit
where “23” is the page ID. This number means post_type ID, so there is no difference between a post ID or a page ID except the post_type itself.
Ref: https://codex.wordpress.org/Function_Reference/get_pages
Hey Dan,
You’re right. Thanks for the simple explanation!