Basic_Group_O_Matic_Example
Plugins

BuddyPress Group-O-Matic: Adding members to groups based on profile fields!

I think it’s safe to say that the Groups Component in BuddyPress is the most powerful component within BuddyPress. There are countless plugins available that extend the groups component, and I use Groups for pretty much every BuddyPress project I do. What has been missing though, is a flexible and powerful solution for BuddyPress site owners to streamline the group joining process.

For lots of communities you want to add your members to groups as soon as they sign-up for your site. Or maybe you want to put extra focus on certain groups because they are crucial to your community. BuddyPress Group-O-Matic is the newest plugin we (PressCrew) developed for BuddyPress communities and offers site administrators some really powerful ways to achieve exactly this.

So what does the BuddyPress Group-O-Matic Plugin do?

In a nutshell it adds a new set of options to the BuddyPress Profile Fields screen that allows you to put your members in groups based on the selection or answer they have given for that field.

Sounds cool… How do I set it up?

Good question! Let’s start with the basics!

Download BuddyPress Group-O-Matic from the plugin repository

1: Create your super duper xProfile field

For this example we’ll pretend that we have a community based around the movie director Guy Ritchie, and we want to put our members into the group that corresponds to their favorite Guy Ritchie movie.

So we’ll create a new xprofile field in the BuddyPress profile field screen in our WP Admin.

Choose your favorite movie using the Dropdown field below
* Snatch
* Sherlock Holmes

You’ll probably already notice the new BuddyPress Group-O-Matic box below, but don’t touch that yet. We’ll get to that later! You should have something like this (click the image for full size)

Screen Shot 2012 03 07 at 2.33.14 PM 300x233 BuddyPress Group O Matic: Adding members to groups based on profile fields!

2: Create your super duper Groups

Now that we’ve created our possible selections, we’ll create the groups using the exact name*as we’ve named our profile field selection options. For our example we’ll create a group called ”Sherlock Holmes” and a group called “Snatch”. Like this:

Screen Shot 2012 03 07 at 2.50.57 PM 300x182 BuddyPress Group O Matic: Adding members to groups based on profile fields!

As stated before, make sure your group name matches exactly.

3: Use Group-O-Matic magic to link them together

Go back to your “Favorite Movie” profile field you created in step 1. It’s time to set up the Group-O-Matic box at the bottom of the screen. Here’s all you need to do:

Free Group O Matic BuddyPress Group O Matic: Adding members to groups based on profile fields!

So what does this stuff mean? In plain English this is what we’ve done:

“See if the Group Name (Attribute) has the exact name as the answer that has been given by your members (Pattern). Then automatically join the user to this group.”

If you’ve ever looked at your WordPress Permalinks or the WordPress SEO plugin by Yoast, you’ll see that Group-O-Matic lets you put in some funny looking code in the “Pattern” box. Don’t get confused, the %answer% input just lets Group-O-Matic know you want to use to the exact answer given by your users, and let Group-O-Matic put the user in the group with that name. Because we’ve given our profile dropdown options and our group names exactly the same name, this works great.

Marshall (the plugin author) has also made a quick video guiding you through this process.

Note: The Premium version of Group-O-Matic gives you much more flexibility in this aspect. You can use wildcard matching so your profile fields and groups names do not have to match exactly. This is great for when you have groups with weird names or slugs. For example your group could be named “Snatch Movie Fan Club” and your profile field option could just be called “Snatch”.

Check out the brilliantly designed screenshot mock-up below (ahem!)

Basic Group O Matic Example 1024x487 BuddyPress Group O Matic: Adding members to groups based on profile fields!

Awesome right?! You’ve now mapped a profile field to a BuddyPress Group. Every member that goes through the registration process will now automatically be put in the group based on that xProfile field selection. You can do this for multiple profile fields and have fine grained control over your community. Some ideas for profile/group mapping;

  • Language
  • School
  • Department
  • Age range
  • Skill Level
The possibilities are pretty much endless!

Stay tuned for another tutorial related to BuddyPress Group-O-Matic Pro

In the next tutorial we’ll take a look at how you can force your users to select a certain group after they’ve registered for your community, and how you can add the Group activity as a main Activity Stream Tab. This is all done with the Pro version of the plugin which is available in the PressCrew shop. Check out the screenshot below for a preview of showing Group Activity under a Activity Stream tab:

Screen Shot 2012 07 05 at 1.05.07 PM BuddyPress Group O Matic: Adding members to groups based on profile fields!

Check out BuddyPress Group-O-Matic Pro

About Bowe Frankema

 BuddyPress Group O Matic: Adding members to groups based on profile fields! Building communities on BuddyPress is something I’m very passionate about. The decision to focus exclusively on BuddyPress projects over the last few years inspired me to share back some of the things I've learned here on BP-Tricks! You can find me on WordCamps & BuddyCamps across the globe and on Twitter! Follow me on Twitter

I'm constantly updating my BuddyPress Hosting Guide and SiteGround and WPEngine
have proven to be a great fit for hosting your BuddyPress community.

Need some help finding the perfect host? Check out my in-depth BuddyPress Hosting guide!

Discussion

6 responses to ‘BuddyPress Group-O-Matic: Adding members to groups based on profile fields!

  1. awesome. Nice work Bowe :)
    It reminds me one of the plugin I created which allows to automatically join groups based on what user posts to the activity.
    Looking forward to see more from PressCrew :)

  2. Hi i was just wondering can i use Group-O-Matic Pro, for user profile for example user mast completle they profile and select the group they wish to join if they skip it or trys to they will get a error message saying please completely your profile, pretty much the same as you have demonstrate on your video, I just need to know if i can use for user profile as well?

    • Yes this is possible! You can force a certain profile field to be filled in. If the user does not do this he will be redirected to their “Edit Profile” screen and will not be able to access the site :-)

  3. Hi, just discovered your awesomeness. I have a community on my hand right and I looking for a plugin with similar features like group-o-matic that will match/suggest groups and friends for registered users members based on their profile. The group-o-matic matched groups what if I want to match friends based on their profile info? Thanks

  4. I am looking for a way to auto join members to groups based on their email addresses. I added a new field email #2 and created the different groups – group 1 and group 2. I attempted to add the logic if group name = %answer% auto join but that didn’t work. Can anyone help?

Leave a Reply

Your email address will not be published. Required fields are marked *

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