BuddyDev

Add new members to BuddyPress groups automatically

If you are looking to add new members to one or more BuddyPress groups automatically, this post will help you.

You can use the following code and put it in your bp-custom.php

All you need to do is change the $group_ids with your own group ids. if you are looking to find out the BuddyPress group ids, you may want to check this tutorial.

Also, this works nicely with our BuddyPress Ajax Registration Plugin as well as BuddyPress Auto Activate Auto Login plugin.

Hope the code helps some of you. have fun building a great social network with BuddyPress!

5 Responses to Add new members to BuddyPress groups automatically

  • Awesome!
    What about adding a new member to a group based on their member type (or a user role)?

    EX: User registers on a site and joins as a Sports Fan (Member type) and upon account activation user is automatically added to Sports Fans (Group).

    Would be great on-boarding when working with several member types and groups. (and even group types).

    • Thank you.
      That’s a good idea and can be easily done. The only requirement will be assigning member type to the user before we wpply the above code.

      Are you using our BuddyPress Members Types plugin? If yes, I can update the post to show an example.

      Regards
      Brajesh

      • Thanks, Brajeesh!

        On one project I used / use the Member Types plugin and on another I added them manually. (use the select member type as profile field one as well)

  • Hi Brajesh! Just saw the Member Types Pro plugin. Is this a newer one??

    I’ve been working on non-BP work for awhile so I haven’t been deep in BP the last couple months, but the overview of the plugin sounds ideal.

    Seems to do several things that I’ve looked for in a single codebase for awhile.

    Hopefully people realize how powerful a set of features that plugin provides for building dynamic communities.

    Great job!

    https://buddydev.com/plugins/buddypress-member-types-pro/

    • Thank you.
      Yes, It is a new one and I have tried to make it as feature rich and useful as possible.

      Thank you for the kind words, I am glad you liked it and I am sure It will help a lot to others too 🙂

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