Groups is designed as an efficient, powerful and flexible solution for group-oriented memberships and content access control.

It provides group-based user membership management, group-based capabilities and access control for content, built on solid principles.

Groups is light-weight and offers an easy user interface, while it acts as a framework and integrates standard WordPress capabilities and application-specific capabilities along with an extensive API.

Enhanced functionality is available via Official Extensions for Groups.

Groups is a WordPress plugin that provides group-based user membership management, group-based capabilities and content access control. It integrates standard WordPress capabilities and application-specific capabilities along with an extensive API.

Documentation

The official documentation is located at the Groups Documentation pages.

Features

User groups

  • Supports an unlimited number of groups
  • Provides a Registered group which is automatically maintained
  • Users can be assigned to any group
  • Users are added automatically to the Registered group

Groups hierarchy

  • Supports group hierarchies with capability inheritance

Group capabilities

  • Integrates standard WordPress capabilities which can be assigned to groups and users
  • Supports custom capabilities: allows to define new capabilities for usage in plugins and web applications
  • Users inherit capabilities of the groups they belong to
  • Groups inherit capabilities of their parent groups

Access control

Access to posts, pages and custom post types can be restricted by group.

If access to a post is restricted to one or more groups, only users who belong to one of those groups may view the post.

Fully supports custom post types, so that access to post types such as products or events can easily be restricted.

  • Built-in access control that allows to restrict access to posts, pages and custom content types to specific groups and users only
  • Control access to content by groups: shortcodes allow to control who can access content on posts, show parts to members of certain groups or to those who are not members –
    Shortcodes: ,
  • Control access to content by capabilities: show (or do not show) content to users who have certain capabilities –
    Shortcodes: ,
  • Blocks: The Groups Member block allows to restrict the visibility of its content to members of selected groups.
    The Groups Non-Member block hides its content from members of chosen groups.
    The blocks can be nested to provide multiple layers of access control to content.

Easy user interface

  • Integrates nicely with the standard WordPress Users menu
  • Provides an intuitive Groups menu
  • Conceptually clean views showing the essentials
  • Quick filters
  • Bulk-actions where needed, for example apply capabilities to groups, bulk-add users to groups, bulk-remove users from groups

Sensible options

  • Enable access restrictions by custom post type
  • An optional tree view for groups can be shown when desired
  • Provides its own set of permissions
  • Administrator overrides for tests
  • Cleans up after testing with a “delete all plugin data” option

Framework

  • Groups is designed based on a solid and sound data-model with a complete API that allows developers to create group-oriented web applications and plugins

Multisite

  • All features are supported independently for each blog in multisite installations

Extensions

Enhanced functionality is available via official Extensions for Groups.

Groups is a large project that is providing essential functionality to tens of thousands of sites since 2012. By getting an official extension, you help fund the work that is necessary to maintain and improve Groups.

  • Groups WooCommerce : Sell Memberships with Groups and WooCommerce – the best Group Membership and Access Control solution for WordPress and WooCommerce.
  • WooCommerce Product Search is the essential extension for every WooCommerce store. It provides the best Search Engine and Search Experience for WooCommerce and is compatible with Groups and its access restrictions on products.
  • WooCommerce Group Coupons : Automatically apply and restrict coupon validity for user groups. Offer exclusive, automatic and targeted discounts for your customers.
  • Groups Drip Content : Release content on a schedule. Content dripping can be based on user account creation, group memberships and specific dates and times.
  • Groups File Access : Allows to provide file download links for authorized users. Access to files is restricted to users by their group membership.
  • Groups Restrict Categories : Features access restrictions for categories, tags and other WordPress taxonomies, including support for custom post types and taxonomies.
  • Groups Forums : A powerful and yet light-weight forum system for WordPress sites.
  • Groups Import Export : Provides import and export facilities around users and groups.
  • Groups Newsletters : Newsletter Campaigns for Subscribers and Groups, also integrates with WooCommerce.
  • Groups Gravity Forms allows to add users to groups automatically, based on form submissions.
  • Widgets Control Pro : An advanced Widget toolbox that adds visibility management and helps to control where widgets are shown efficiently.

Get involved

You & Groups

Beta-testers and developers who need to integrate group-based features in their plugins and web applications: please use it and provide your feedback.

Feedback

Feedback is welcome!

If you need help, have problems, want to leave feedback or want to provide constructive criticism, please leave a comment below.

Please try to solve problems there before you rate this plugin or say it doesn’t work. There goes a lot of work into providing you with free quality plugins! Please appreciate that and help with your feedback. Thanks!

Stay informed or contribute

Follow @itthinx (or on Reddit, Mastodon, … ) for news related to Groups and other plugins.

Get development notifications, contribute code or open issues at the repository on GitHub.

Translations

Translations have been contributed by many from the WordPress community, via the GitHub repository Groups, the section for Groups on Translating WordPress or as direct contributions.

Where to get Groups

Groups is free. You can install it directly from your WordPress dashboard or download it from the Groups plugin page and install it manually.


Comments

2,693 responses to “Groups”

  1. Thanks very much for your prompt response. My site admins – who are neither patient nor particularly tech-savvy – just need a means of contacting their various groups with short, one or two line messages from time to time. Permissions and the ability (of users) to opt in/out etc are not issues on this site. Reading through the description of Groups Newsletters, it initially seemed to me that it offered many facilities and options which we probably wouldn’t use, but that those might detract from ease-of-use. In view of your comments, I’d be happy to give your plug-in a try – what do I do next?

    Kind regards
    Michael.

    1. Hi, you can buy it in Codecanyon.
      cheers

    2. @Antonio I offered him to try it out before deciding to buy it there!
      @Michael I’ll give you access.

  2. Looking through these comments, I see plenty of people interested in a way of emailing their groups. I wondered if you had considered an integration with the ‘Email Users’ plug-in found at http://michaelwalsh.org ? I’m aware of the Groups Newsletters plug-in, but this is really overkill for what I want to do.

    1. I created Groups Newsletters precisely to cover a wide range of applications related to distributing information to group members, including the very basic sending out emails to groups. So I wouldn’t really be interested in the extra effort to do an integration with another plugin myself. Would you like to try Groups Newsletters? I’d appreciate the feedback and you can decide to get the license after that. It certainly isn’t overkill for mailing group members, although it’s very flexible 😉

  3. Thank you, the Groups 404 plugin is going to solve a major problem for me.

    About the shortcodes, I’m sorry but I didn’t understand how to proceed.

    I’d like my customers to find a list of the links they have access to in their Woocommerce account.

    Currently, they can see what they bought with a link to the product page but what I’m selling is the access to a specific page where they can see a specific video streaming.

    This is that specific page I’d like to show to them. I’m selling different ones so their can be multiple links.

    For now, they are receiving the link by email but some are complaining it’s not very convenient to have to go through your emails to find the link each time you want to look at the video.

    I have to agree with them.

    I hope you can help me.

    Thank you so much for the great job you’re doing !

    1. Hi,
      if you sell access to group “VIP”, you can create a capability for this group (for example view_videos_vip) and assign it to this group.
      When you create your private posts (…/video1 …./video2 …), add this capability.
      In your user profile page, you can create links to this posts, and only VIP users will can see.
      cheers

  4. Hello,

    In the beginning I contacted Woothemes support for that matter but they said it was related to your plugin, not their’s. They told me to contact you instead for support.

    I hope you can help me.

    I just bought Groups for Woocommerce and set it up. My main issue is I didn’t find a way to custom the denied access page.

    I’d like to be able to customize the page for each group to invite potential customers to purchase the corresponding access to the content.

    How do I sell memberships with Groups for Woocommerce
    with no way for my customers to find the content they bought ?

    Thank you.

    1. Hi there,

      You can use Groups 404 Redirect to head them over to a page where you indicate alternative content when someone tries to access a protected page.

      And for those who have purchased membership, you can set up content using the shortcodes. For example, when a member is accessing the page you can use that to show links to protected pages.

      I hope you will find that useful.

  5. Hi,

    is it possible to create a special type of groups? I’d like to have three types: Family (only a parent could create this kind of group and add their kids there), Class (created by teachers), Training (created by instructors). How do I go about it?

    Thank you in advance!

    1. Hi Sylwia,

      You would probably create three groups and use one or more capabilities assigned to them. Then use the capabilities to protect the content accordingly and assign the users to the appropriate groups. The FAQ section has an example.

      Cheers

  6. We have a small newspaper site and I am trying to use Groups and am running into a difficulty. With a basic install using just the Registered group with the capability of group_read_post the posts show up just fine on the homepage for registered users. The issue comes into play with non-registered users – they don’t see the post at all on the homepage once I click the box in an individual article’s Enforce Read Access box. No headline, no excerpt, nothing. It’s as if the post doesn’t exist.
    I would like to have the post and automatically generated excerpt show up still but when the non-registered user clicks to read the article it goes ahead and redirects them.
    The only way around this I’ve found so far is to use the short codes
    [groups_member group="Registered"]
    Article text here….
    [/groups_member]
    [groups_non_member group="Registered"]
    Please go to sign up link here
    [/groups_non_member]
    Doing that and then using the excerpt field I can bring the post back to the homepage but it is VERY time intensive to setup each article we post that way and when non-registered users visit the article everything that loads after the short codes is rendered in a typewriter like font.
    Is there any way to achieve the behavior I am looking for where all the home page info stays visible and as is to non-registered users but yet still protected when they click on any of the articles and are redirected to a signup/purchase page?

    1. Hi,
      if you want that users can access to a post/page, but show content only when they are registered, you must use shortcodes.
      If you want that users can not access to a restricted post/page, you must use capabilities.
      With Groups 404 Redirect you can redirect non registered users to a signup/purchase page.
      cheers

    2. @Josh

      I ran into the same issue you describe and came up with a solution. I published a tutorial on the process and the link is below. Note: the tutorial is a follow-up to a previous tutorial; although, the solution should still work in your setup.

      The basic premise is that you remove the Groups restrictions for certain pages on your site, such as the home page.

      http://xd3v.com/bypassing-groups-restrictions/

  7. hello,
    first of all thanks for sharing such a great plugin.
    I have 10 groups and want to users can select their group. Is it possible?
    thanks in advance

    1. Hi,
      you can add this permissions in Groups->Options->Permissions (for example to Editors). And check “Show groups in user profiles.”.
      But beware this allows users can create/delete/edit groups and capabilities.
      cheers

  8. Groups 1.3.11 has a bad conflict issue with OptimizePress2. There appears to be something happening that blocks Javascript from executing properly and Groups is definitely the plugin conflict. Would someone please be so kind as to look into this?

    Issue: With Groups activate the Live Editor in OP2 fails to update after changes are made. Elements from the live editor vanish (instead of re-post with the updated version) as a result of some conflict between this plugin and that theme and/or plugin.

    1. That doesn’t sound like something Groups would do:

      There appears to be something happening that blocks Javascript from executing properly and Groups is definitely the plugin conflict.

      Do you have any debugging info that might support this assumption? Also, have you tried asking the makers of OP2 about this?

  9. I have just been updating a client site to use WP 3.5.2 and the latest version of groups but this is now the error I get once the updates were complete on the staging site.

    Fatal error: Call to undefined function wp_get_current_user() in C:\xampp\htdocs\flexiant\wp-includes\user.php on line 209

    All other plugins are fine and I disabled all the remaining ones to narrow it down to the groups plugin. Is this something anyone else has experienced when updating to WP 3.5.2 and Groups 1.3.11

    Thanks

  10. Just FYI – xd3v has published an in-depth tutorial on creating a social network with Groups being a key ingredient. Hope someone finds it useful.

    http://xd3v.com/create-a-premium-social-network-with-woocommerce/

    1. Thanks Joey, I’ve just read through the parts related to Groups and I think this is a very useful example. Great stuff!

  11. Hi

    Is there any way to use capabilities to achieve the following? I have a membership group that have access to a set of blog posts, that are otherwise protected. I want non-members to see the posts exist but not the content, i.e. to see tasters. On clicking the tasters I would like the non-members to be forwarded to a sign-up page for the membership group, so they can then get access to the full posts. I tried using groups_read_post, but it hides protected posts in their entirety from non-members.

    I would like to use capabilities rather than shortcodes, because I believe doing so would save me from having to put shortcodes in every post I want to protect.

    Thanks.

    Richard

    1. antonio Avatar

      Hi,
      with Groups 404 Redirect plugin, you can redirect non-members to a post.
      cheers

      1. Richard Tandoh Avatar
        Richard Tandoh

        Thanks for the response.

        Groups 404 Redirect works for the redirection, but it does not help with the tasters/teasers.

        Would it be possible to adapt Groups – or maybe there is another way, say, via a custom capability – to show the title (and excerpt) of a post to all, but only the full post to members?

        Thanks.

        Richard

        1. sorry, you can use [groups_member] and [groups_non_member] shortcodes, for example:

          [groups_non_member group="Premium"]
          This text can only be seen by non-members
          [/groups_non_member]
          [groups_member group="Premium"]
          This text can only be seen by members of Premium group
          [/groups_member]

          cheers

  12. Does Group provide a widget or shortcode for website visitors to register as two different/separate roles (affiliates or subscribers)
    and for the administrator to approve those registrations and grant access accordingly ?

    1. Groups doesn’t work with roles, one of the motivations for its creation was to be able to overcome roles 🙂

      The way this works (very simplified) is that registered users can be assigned to any set of groups, where their group membership can then be used to restrict access to content.

  13. After I initially left a comment I appear to have clicked on the -Notify me
    when new comments are added- checkbox and now every time a comment is added I get four emails with the exact same comment.
    There has to be a means you can remove me from that service?
    Appreciate it!

    1. antonio Avatar

      Hi,in the email, you have a link to unsubscribe from notices. regards

  14. Hi, great plugin, many thanks!
    But i cant resolve 1 problem.
    I have woocommerce, there are products whitch shows only to a group (products hidden for not logged guests), it works great!

    Can i make group for non-logged guests with other options?
    Need to show other products to non-logged users but hide it from logged users.

    Regards.

    1. Thanks for using it 🙂

      You could work with the Groups API within the product template and the product category template to check whether a visitor is logged in and belongs to a group, then show content based on that.

  15. Currently I sell movies via download. I also wish to sell a rental movie for 24hr period at $2.99. I use woocommerce.

    Could I use groups woocommerce and set up a ‘rental group’. Each movie would be a ‘rental group product’ with a price $2.99. I set a time period of 24hrs for this product (movie). I then set up a restricted page that holds the movie player.

    So for example user buys ‘movie ABC’ and pays $2.99 at checkout where he becomes a member. He then receives the email with a link to the restricted page that holds ‘movie ABC’. After 24hrs his membership expires – the ‘rental group product’.

    Can this work? Thank you.

    1. I have this almost setup – not tested yet. The product which is a movie is essentially the membership for 24hr period. Customer buys ‘movie’ and gets a url to view the restricted page where the player resides.

      Having trouble getting the url to be issued to the customer though.

    2. antonio Avatar

      Hi,
      you can use Groups Woocommerce for this purpose.
      Create a group for each movie, and sell access to those groups (in edit product page you can setup duration to 1 day).
      regards

  16. Hello
    User GROUPS plugin, I’d like to know if there is a way to send an email to groups via the backoffice site.
    I find this very interresting use.
    Essemble targeted newsletters or promotions dedicated to groups

    Regards

    1. antonio Avatar

      Hi,
      you can use Groups2Mailchimp Integration, and use Mailchimp as newsletter service.
      cheers

    2. antonio Avatar

      Hi,
      plase take a look to Groups Newsletters.
      cheers

  17. Hi there! Great plugiin – one quick question:

    Once my members login and navigate back to the site, they are having to refresh the page to see the protected content. Any way to force the page to refresh without the members having to do so manually?

    Thanks!

    1. antonio Avatar

      Hi,
      when you pressed back button, the browser tries display it out of the cache, which is much faster.
      Maybe Peter’s Login Redirect plugin can help you prevent users use the back button.
      cheers

  18. When I originally left a comment I seem to have clicked
    the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I recieve 4 emails with the exact
    same comment. Perhaps there is a means you can
    remove me from that service? Thanks a lot!streetdirectory

    1. antonio Avatar

      Hi,
      in the email received you have a link to unsubscribe to notifications.
      cheers

  19. You’re welcome and thanks for the reply!

  20. Good Day

    I would like to use the plugin, but the moment I activate it on the website – http://www.africalegislation.com then I cannot get into the Admin section anymore.

    I see the WordPress banner at the top indicating that I am signed in, but the moment I click on any of the admin actions then it takes me automatically back to the home page of the website. I am on wordpress 3.5.2.

    The plugin is currently deactivated.

    I would just like to know if you have any ideas on how I can resolve this issue?

    Thanks!
    Marianna

    1. Good Day

      You can ignore as we found the problem in our theme. Once we fixed this the plugin started to work

      Regards
      Marianna

      1. antonio Avatar

        Hi,
        I’m glad that works fine.
        cheers

  21. Hi there!

    Love the plugin! Is there anyway to bulk upload groups or capabilities with a CSV file?

    1. Hi Kurt, many thanks 🙂 If you can find the time, please rate it on WordPress, the more positive feedback it gets the better!

      The easiest way I can think of for that would be to import the groups and capabilities directly into their tables in the database. See Import CSV file directly into MySQL on how to do that. The tables you need to import the data into would be wp_groups_group and wp_groups_capability (assuming the default table prefix wp_ is used). On the group table the value for the name column must be provided, on the capability table it’s the capability.

  22. Kento,

    How do I restrict by URL? I have a forum (bbpress and buddypress)that is for paying monthly members only and I have just learned that every new topic, reply, post, etc is public until I check the box in the back end editor. The forums home page and menu is restricted, but if you have a link to a forum, topic or reply, it is not restricted by default.

    My Current Plugins setup:
    bbpress
    buddypress
    Woocommerce
    Groups
    Groups Woocommerce
    WooCommerce Subscriptions
    Groups 404 Redirect

    Thank you

    1. Hi Nick,

      An easy solution that I can think of is to modify your theme pages to check whether the current user should have access. Or you could probably build on Groups Forums Restricted – this plugin is intended to work together with Groups Forums, but I think you could use it as a starting point to protected your bbpress-based forums.

  23. I want a plug in that will allow me to have different groups. South austin Memories wants to have page and a group for each graduating class of the high schools from South Austin. People will join their high school class. Want to make it easy for reunions. Might need to be multi site, I do have the empire builder plugin which makes a wordpress blob multi site. Would like your ideas.

    1. I can’t say if it will be a perfect fit for what you plan to do, but you can give it a try. You can establish a group for each class and let people join their corresponding group freely. See the Shortcodes section in the documentation for details on the [groups_join] and [groups_leave] short codes.

      If that seems appropriate, then the Groups Newsletters plugin could be used to communicate information about events and other relevant information to group/class members.

      Also Groups Forums could be used to provide discussion spaces for alumni.

  24. I contacted via email, but now following up. Our web developer posted above about an issue with our search results and the Groups plugin.

    http://www.itthinx.com/plugins/groups/#comment-7779

    Subsequent versions have not fixed the problem. Please contact me about this issue, since we would like to implement a fix as soon as possible. Thanks.

    1. antonio Avatar

      Hi,
      this must be fixed, please give us the website link to take a look (and if is possible, an user with restrictions).
      cheers

  25. How feasible would be adding a date tag to users?

    EX: [groups_member group="Registered" after_date="xx/xx/xx"]

    So only users who registered after that date can see the content.

    This would make selling digital magazine subscriptions way easier so people could become members, but wouldn’t have complete access.

    1. antonio Avatar

      Hi,
      you can use Groups Subscriptions to sell digital access.
      cheers

      1. I am aware of that. But the Groups Sub plugin does not support date-based access, does it?

        1. antonio Avatar

          Hi,
          no, there isn’t an attribute for this purpose.
          cheers

          1. Every digital magazine on the planet needs this functionality. It might be a great premium add-on to develop. I know I’d buy it!

            1. antonio Avatar

              certainly looks interesting, thanks for the feedback

  26. Eric Bailee Avatar
    Eric Bailee

    Hi,

    I am eager to know if this plugin can do the following or if this and another plugin can achieve it?

    I want to have various groups, within each group are registered users. Each group contains and administrator/Author where they can view and edit all users in that specific group and for that group ONLY.

    When a user logs in, it only shows the user’s profile page, group name, post/attachments.

    Is this possible?

    1. Eric Bailee Avatar
      Eric Bailee

      Hi,

      I noticed my question is still sitting in moderation, is it possible to achieve having this functionality where a group admin/author or contributor can have access to all users in that group and can see the list of users in that group.

      Other groups should not see other groups, but their own, something like:

      GROUP 1
      |
      ADMIN USER FOR GROUP 1, CAN ONLY SEE USERS IN GROUP 1
      |
      USER 1
      USER 2

      GROUP 2
      |
      ADMIN USER FOR GROUP 2, CAN ONLY SEE USERS IN GROUP 2
      |
      USER 3
      USER 4

      Thanks

    2. It can be done using Groups’ API, probably even just using the capabilities and assigning them in the right way to groups. I haven’t done it myself, but as all the capabilities that WordPress uses can be assigned to groups, it might just be a matter of investigating if the right capabilities are there and then assigning them to the group(s).

  27. Seb D. Avatar

    Another two questions 🙂
    Is it possible to rename the Registered Group (Membre, in french) ?
    I can rename it in the database, but i would like to be sur no issues came with that.

    Remove the long list of capabilities in Groups > Capabilities does have an impact with the real wordpress capabilities ?

    Thanks !

    1. You shouldn’t rename it in the database, the Registered group is referenced internally by name and should not be removed or renamed.

      You can remove the capabilities but it will effectively remove a lot of the advantages the Groups offers.

  28. Seb D. Avatar

    Hi !

    One little ask.
    Is there a way, when creating/editing a page, to choose access by group, and not by capabilities ?

    Sébastien

    1. antonio Avatar

      Hi,
      you can restrict some content with groups, but total access must be with capabilities.
      You could create one capability per group, and call it equal.
      cheers

  29. In other words, here is my code, which has worked and suddenly stopped working unexplainably:

    $user = get_current_user_id();
    if ( Groups_User_Group::read( $user, ‘1’ ) ) { echo “”; }
    elseif ( Groups_User_Group::read( $user, ‘2’ ) ) { echo “”; } else { echo “”; };

    Now no matter what, only the third case gets activated and it is always prompting three.css. why?

    1. antonio Avatar
      antonio

      Hi,
      you can get user’s groups, for example:

      $user = new Groups_User( get_current_user_id() );
      $groups = $user->groups;
      foreach ($groups as $group) {
      echo $group->name . ",";
      }

      cheers

      1. Thanks

        So this adds all the groups this user belongs to as an Array in $groups ?

        1. antonio Avatar
          antonio

          yes, in this case $groups is an array.
          cheers

          1. Well I am using the following code, I am just trying to check if they belong to one particular group and execute code, but I don’t want to loop it because I only want it to run once:

            $user = get_current_user_id();
            if ( Groups_User_Group::read( $user, ’28’ ) ) { echo “”; }
            elseif ( Groups_User_Group::read( $user, ’29’ ) ) { echo “”; } else { echo “”; };

            The problem is that this code seems to work and suddenly stops working. and then suddenly works again.

            1. antonio Avatar

              Hi,
              please, take a look to this comment, maybe it can help you.
              cheers

          2. It doesn’t let me reply to your last comment for some reason.

            In any case, i am not sure what that code in that comment does exactly and how to I apply it to my case. in what way does it differ from what I’ve done?

            Thanks

            1. antonio Avatar

              Hi,
              I thought it best to use the group name, in case the id was wrong.
              But you can try:

              if ( class_exists('Groups_User_Group'))
              echo "OK";
              else
              echo "ERROR Groups is not loaded"

              to verify that your code is not launched before loading groups.
              cheers

  30. For the love of goodness. all I want to do is get the current logged in user’s group. either group name or group id i don’t care. and not in shortcode, in php.

    How do I do that?

  31. WooCommerce Dynamic Pricing now supports the Groups plugin. You can control if an advanced rule applies to specific groups, or use the new Simple Group module for applying price adjustments to all members of a group.

  32. Francois Wessels Avatar
    Francois Wessels

    Hi there,

    Can Groups allow only a specific user to edit a custom post type — for instance listings for property where I would like to enable the agent to edit his/her own listing but not other agents listings.

    Kind regards

    Francois Wessels

    1. antonio Avatar
      antonio

      Hi,
      you only need create a capability for every user, and assign this capability to the post.
      For example:
      create capability: “canUserA”
      Assign “canUserA” to user “A”
      In Groups->Options: select this capability to be offered to restrict access to posts.
      In “postA” assign Access Restriction “canUserA”
      cheers

  33. Found myself needing to systematically create new capabilities, groups and relationships for a custom post type using the API. The API documentation was very helpful, but also thought some examples would be helpful for others that are looking to do some similar things. Here’s some code snippets that could come in handy. No guarantees that these are the most efficient calls to make, but they’re working for me.


    $capname = 'new_capability';
    $groupname = 'New Group';
    // Create a new capability labeled $capname. Give it the description of $groupname for easy reference.
    Groups_Capability::create( array( 'capability' => $capname, 'description' => $groupname ) );

    // Create a group with the name of $groupname.
    Groups_Group::create( array( 'name' => $groupname) );

    // Get the group object using $groupname (so you can get the group ID later)
    $group = Groups_Group::read_by_name( $groupname );

    // Get the capability object using $capname (so you can get capability ID later)
    $capability = Groups_Capability::read_by_capability( $capname );

    // Create a relationship between the $capname capability to the group $groupname using the objects you got earlier.
    Groups_Group_Capability::create( array( 'group_id' => $group->group_id, 'capability_id' => $capability->capability_id ) );

    // Get the group object called "Membership"
    $membergroup = Groups_Group::read_by_name( 'Membership' );

    $ispartmember = 1;
    // Do you also want to make this capability part of the "Membership" group?
    if( $ispartmember ) {
    // Tie the $capname capability created earlier to the 'Membership' group you just retrieved.
    Groups_Group_Capability::create( array( 'group_id' => $membergroup->group_id, 'capability_id' => $capability->capability_id ) );
    }

    // Grant access to this post ($post_id) to the $capname capability.
    update_post_meta( $post_id, "groups-groups_read_post", $capname, $capname );

    // Delte the $capname capability (using the object you got above)
    Groups_Capability::delete( $capability->capability_id );

    // Delete the $groupname group (using the object you got above)
    Groups_Group::delete( $group->group_id );

    // Relabel an existing capability to $newcapname
    $currentcapname = 'current_capability';
    $newcapname = 'renamed_capability';
    $capability = Groups_Capability::read_by_capability( $currentcapname );
    Groups_Capability::update( array( 'capability_id' => $capability->capability_id, 'capability' => $newcapname, 'description' => $capability->description ) );

    // You just changed the capability label. Now update this post so it still grants access to that capability.
    update_post_meta($post_id, 'groups-groups_read_post', $newcapname, $currentcapname);

    // Rename an existing group to $newgroupname and keep the existing Parent relationship
    $currentgroupname = 'current_group';
    $newgroupname = 'new_group';
    $group = Groups_Group::read_by_name( $currentgroupname );
    Groups_Group::update( array( 'group_id' => $group->group_id, 'name' => $newgroupname, 'parent_id' => $group->parent_id ) );

    1. antonio Avatar
      antonio

      Hi Erik,
      thanks, it would be helpful for others.
      cheers

  34. Richard Avatar
    Richard

    Hi,
    Is there a way to display the different groups you have set up in the edit page/post page. So that I can restrict the page/post to a specific group rather than one with a capability? If I have several clients currently I would have to set up a group for each client, and a capability for that client. So that I can restrict a post/page to a specific client.

    thanks

    1. antonio Avatar
      antonio

      Hi,
      you can restrict content to different groups, but not access to page/post.
      You could create a public post/page, and restrict sections in content to different groups.
      cheers

      1. Richard Avatar
        Richard

        Ah ok. I have created a capability for each client, and then in edit page/post I have the ability to restrict per group.

        Thanks

        1. antonio Avatar
          antonio

          You can use [groups_member] and [groups_non_member] shortcodes for this purpose.
          cheers

          1. Richard Avatar
            Richard

            Ok thanks.

  35. Tobias Avatar

    Hi, I would like to show a message using groups shortcodes to members who does not currently have a specific groups “group” membership.

    Ex. a [Not Group=X] message text [/Not Group] style shortcode.

    Is this possibly and if so, what is the proper syntax/usage?

    1. antonio Avatar
      antonio

      Hi,
      you can use [groups_non_member] shortcode. Check out Groups Documentation – Shortcodes .
      cheers

      1. Tobias Avatar

        ok so the syntax would be [groups_non_member group="gold"]Members who isn’t a member of gold group will see this message? [/groups_non_member]

        Have I understood the syntax correctly?

        1. antonio Avatar
          antonio

          yes, correct.

  36. mitesh Avatar

    Is there any way I can add a user to a group in php .i.e. wordpress backend ?

    And is there any way I can move a member from one group to another group, again in php manually ?

    1. Yes, using the methods in Groups_User_Group (see http://api.itthinx.com/groups/class-Groups_User_Group.html) – there are examples of how to add the user here in the comments, removing is done the same way.

  37. Melissa Avatar
    Melissa

    I have 2 groups: Supporter and Member. Supporter will see some page content, members will see the supporter content PLUS their own additional content. I setup the groups and capabilities as laid out in the FAQ “Advanced/Premium” question. I am able to get this to work correctly if setting Access Restrictions on a post itself, but not seeing how to do this with shortcodes. I currently have two shortcode blocks, one for group=”Member” and one group=”Supporter”. When I login as a member, in only see the member content, not the supporter content as well. Please advise!

    1. antonio Avatar
      antonio

      Hi,
      you can use group=”GroupA,GroupB”, in your case:

      [groups_member group="Member"]
      This content is only available for Members.
      [/groups_member]

      [groups_member group="Member,Supporter"]
      This content is available is you are a Member OR a Supporter.
      [/groups_member]

      cheers

      1. Melissa Avatar
        Melissa

        Thanks! Is there a way to rid of the white space that shows up on the page when these are in place.
        If I have the example above in place and a regular user sees the page (not able to see any of the supporter or member content), it shows two blank lines.

        1. antonio Avatar
          antonio

          Hi,
          newlines before, after and between shortcodes are showed.
          In this case, if you have:

          Text before.
          [groups_member group="Member"]
          This content is only available for Members.
          [/groups_member]
          Text after.

          Shows two blank lines.
          But if you use:

          Text before.[groups_member group="Member"]
          This content is only available for Members.
          [/groups_member]Text after.

          You have not blank lines.
          cheers

  38. Melissa Avatar
    Melissa

    I installed the Groups plug-in, added 2 new groups, but I can’t see where to add my test user to a group! Please help!

    1. In the User section you should see the selection box on top. If not, there might be a conflict with another plugin. With 1.3.11 just released, you can also enable editing group memberships on a user’s profile under Groups > Options > User profile.

      1. Melissa Avatar
        Melissa

        Thanks, got that part figured out!

  39. Hi,

    Is there a way to get posts to be configurable for different user groups? Say, free, standard and premium, and have only some posts visible for a specific group? I can only find “groups_read_post”, so not sure if there is another way?

    Thanks!

    1. Hi Henk, there’s an example on the FAQ page. It’s very flexible: you can freely enable any number of existing or new capabilities to restrict access. Assign these capabilities to the groups that should be allowed to view the posts, this means that you can have groups that can access independent as well as related subsets of posts …

      1. Wow. Sorry for the noob question. I don’t know why I didn’t think of checking for a FAQ. Must be a combination of lazyness and a brain fart.

        I’ll check it out, thanks!

        1. 😀 no worries, actually there should be an examples section on this stuff here on the site in the documentation section.

  40. How can I restrict a whole page for only guests?

    1. antonio Avatar
      antonio

      Hi,
      you can use for example:
      [groups_non_member group="Registered"]bla bla bla [/groups_non_member]

      cheers

      1. Hi,

        That looks like that only restricts the content between the shortcodes. I need to restrict the whole page so it only shows in menu for guests…Thanks!

        1. antonio Avatar
          antonio

          Hi,
          if you want restrict menu item visibility, you need a plugin for this purpose, Menu Item Visibility Control seems to do that.
          cheers

  41. this is a great plugin. however I need to be able to have some ability to manually add users to specific groups, independent of their having paid for a subscription. Free subscriptino basically. I need to be able to do this because I’m moving one site to another. I tried to do this in the WP users menu, but there doesn’t seem to be a way to modify that

    help

    1. antonio Avatar
      antonio

      Hi Mike,
      you can do it, checking the desired users, and Add/Remove to group using the buttons just above the users table.
      cheers

  42. thank you for your quick response

    I tried to do it but nothing happens in my page below the form.

    http://www.albarakagroup.ca/devis/

    1. What’s supposed to happen when you submit the form? If you just place the shortcode below the form and the user isn’t logged in, it won’t show anything because the users have to be registered before you can let them join a group.

  43. mohamed amine Avatar
    mohamed amine

    hi,

    can i have a sgin up with this plugin for registration?

    there is a shortcode for that.

    thx

    1. Hi there,
      I think you’re looking for the groups_join shortcode documented in the Shortcodes section for the Groups plugin.
      Cheers!

  44. I’m trying to use Groups plugin in conjunction with WooCommerce. I have talked to the commerce people and they do not think what I would like to do is possible, and told me to post in the groups forum.

    We are not using this as a traditional shopping cart.

    so for example:

    -You have a company.
    -In this company there are 3 departments.
    -Each department has a department manager.
    -In each department there are many users(customers?).
    -The users should be able to sign in and only see the products for their department, and order/pay for these items.
    -The department manager should be able to login, and see and approve any and all orders placed by his department, but NOT see any orders placed from another department.

    Right now I am having a problem trying to get the last point to work.
    I have already set up users, and roles, and have different products showing up for the different departments.
    HOWEVER when you login to the back end you see ALL the orders placed by every department. I would like the department manager to only see the orders placed by HIS department.
    Is this possible?

    1. Hi karen,
      that is not possible, it would require a custom implementation using Groups API.
      cheers

      1. Okay thank you antonio, I will look into building something on my own that will work.

  45. Groups plug-in 1.3.8. installed on a WP 3.5.1. installation.

    Groups gives me the option to display some columns in the Admin> Users > All Users screen. I can activate this option using the ‘Screen Options’ tab at the top of that page. However, when I look at that pull-down menu, I have the ‘Groups’ tick-box showing up twice. Even if I check both boxes I only get one bunch of group fields showing up on my All Users page. This doesn’t matter too much from an operational POV – but obviously something is not right and I’d like to fix it if possible. Any ideas welcome. TIA

    1. Hi,
      I have tested this version, and only appears once.
      Maybe there is a conflict with other plugin that generates this error.
      You can test desabling other plugins and/or reinstalling groups.
      cheers

  46. Hi,

    I would like to buy the plugin for jigoshop.

    Before that I need to know, is there a shortcode for login information.

    When the user login, could I redirect him to a certain page, not the user dashboard in WordPress?

    Thank you for your help.

    Jan

    1. Hi,
      Groups doesn’t change the behavior of login redirection.
      For this, you need other plugin, you can see Useful Plugins
      cheers

      1. Hey Antonio,

        I have installed the plugin Peter’s login redirect.

        However, I do not know how to set i up. Because I need the user of one group redirected to one page and the users of other group to different page.

        Do you have any guideline how to do it.

        1. Hi,
          I think you don’t do it with Peter’s plugin.
          Maybe, you can redirect to a comun page, and in this page, show a link according to that group belong.
          Code for that page, for example:

          [groups_member group="A"] linkA [/groups_member]
          [groups_member group="B"] linkB [/groups_member]
          [groups_member group="C"] linkC [/groups_member]

          cheers

          1. I see. Then maybe I am missing how to use the groups plugin.

            SO the purpose is to show only some content. To people who are loged in and are members of a group.

            Maybe it would would be worthy to create a plugin that would redirect members of a group to a page which is dedicated only to them.

            The plugin would gain extreme power.

            Please, do not consider my comment as a critique.

            1. antonio Avatar
              antonio

              Hi,
              with groups you can show some content only to the people who are loged in and are members of a group.But you can redirect at login to different pages.

              Don’t worry, all feedback are wellcome, and that you propose is very interesting.

              cheers

  47. alex wolk Avatar
    alex wolk

    Is there a wordpress newsletter or email plugin that works with groups? I would love to be able to send simple newsletters/announcements to different groups through the backend. Do you have any recommendations or other solutions that might work? I would even be willing to pay for some development

    1. Hi Alex,

      That’s something I’d be interested in, too, but I’m not aware of an existing integration with a newsletter plugin. I’ve considered creating a solution based on Groups myself, as several have already expressed interest in ‘something’ like that … it could be an integration with an existing newsletter system that works well, or something built from scratch. We can talk and see what might be interesting 🙂

  48. I’m using you groups plugin in my blog since I need to have different groups of users. Each group of users should see only one category. Everything works wonderful. Every group has his own capacity, etc.

    The only problem I have is that in the wp categories widget, all the categories are shown to all users. IIRC, there is no way to fix this, even if I modify directly the categories widget?

    Thanks in advance!

    1. Hi,
      you must use Groups API for this purpose. cheers

  49. Bulk deleting of default capabilities would be SOOOOOO nice. I don’t want all of these unneeded capabilities cluttering up the screen, and now I have to manually delete every single one!!

    1. That’s right, we’ll look, thanks

  50. It appears search results are viewable regardless of permissions. Clicking on the post will return a 404, but post content is still entirely visible on the search results page.

    Is there a way to give search results the same behaviour (post not displayed if protected) as everywhere else?

    1. Hi,
      We are fixing this error, in the next version you’ll have available.
      cheers

      1. Search results still seem to be visible regardless of permissions in 1.3.11. Any update on when this will be fixed?

        1. antonio Avatar
          antonio

          Hi,
          in version 1.3.11 this is fixed.
          Maybe your test user has capabilities to see all posts.
          cheers

    2. There was never anything that needed to be ‘fixed’ in this respect (@antonio why do you think this has been fixed in 1.3.11? – I might be wrong but I can’t see where any of the changes that I made would have had any impact on that).

      If you get search results that include protected posts, then you have ‘something’ that includes those posts by itself. For example, a direct query to the database. Another reason could be a plugin that is interfering or a function in the theme.

      Things you can do (on a test site which should be a copy of your production site):
      – check how search results are obtained (check the actual algorithm)
      – disable all plugins except Groups and check the results, enable other plugins individually in addition and see if the results are different
      – use a default theme and see if that makes a difference

      I’d be interested to see what is causing this on your site, please let me know your findings.

Leave a Reply

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

Share