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.

Leave a Reply

Are you looking for support?

Please ask support questions in BuddyDev Forum and help us serve you better. Please use comment for general discussion/feature suggestions.

Your email address will not be published. All the fields marked as * are required.

If you are posting code, please use <pre> { Your Code Block } </pre>. Example:- <pre> echo $name; </pre>

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">


Subscribe