BuddyDev

Make BuddyPress Pages Members Only

Do you want to make the BuddyPress section of your site member only? It's pretty easy.

All we need to do is check if a user is not logged in and they are in BuddyPress section and the current page is not Register or activation page, redirect them to login.

Here is the code.

You can put the code in your bp-custom.php or your theme's functions.php

Feel free to customise it as you please.

Happy Networking!

5 Responses to Make BuddyPress Pages Members Only

  • Hi Brajesh,

    This doesn't work.

    Thanks

  • Hi Brajesh,

    I got it to work but too restrictive had to with a plugin for better control.

    Thanks

    • Hi Edward,
      Thank you for confirming that it is working.

      Yes, It restricts whole BuddyPress section except the register/activation page. I am glad you found a plugin that serves the purpose.
      It is feasible to skip some parts by using other conditional such as bp_is_user() , bp_is_group() etc.

      Regards
      Brajesh

  • Thank you Brajesh for the always free tips and tricks for BuddyPress. Great job.