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. Hello!

    Is it possible to set a default access restriction for certain post types, that can then be REMOVED if needed?

    For example, on my site, MOST posts should be restricted to the “members” group, however we have a public post every now and again as well. It would be great if when creating a new post, “members” was automatically added in the access restrictions box, so my contributors don’t forget to add it when they make a post (which happens often).

    Thanks for your time!

    1. Hi Krystal,
      you can use this code to add a capability by default (you need to add this code in your functions.php child theme file).
      You need to change the 160 in the code by your capability id.
      Remember that this capability must be selected in Groups->Options.
      Kind Regards,
      Antonio B.

      1. Oh AWESOME! That is perfect, and exactly what I needed! I just have one follow-up question… is it possible to do this only for certain post types? I see a $post_type variable there, but I’m sorry, not a super code wizard, so I’m not sure how to select only a certain post type.

        If it’s not possible, I can manage – this is still a step up for my site. 🙂

        1. Hi Krystal,
          you can check the $post_type variable, something like this:
          if ( $post_type == "post" ) {
          ....
          ....
          }

          Kind Regards,
          Antonio B.

  2. Hello, Itthinx, long-time Groups user here. Is there any possible way to add users to a group automatically when they view a specific page, or click a specific link, or even having been a user for a certain amount of time?

    I am dripping 3x emails over 3 days to new users, but I want them to be able to access day 1 in the menu after the have accessed day 2, for instance.

    If there are no current solutions for this, do you think it is something i could have built, say on Upwork? Thank you for your support.

    1. Hi Jordan,
      you could add the users automatically to a group when they are registered, and after xx days, remove them from this group.
      You can use the Groups API and these codes as reference:
      This code adds the users to a group automatically when they are registered.
      This code add/remove the users to/from a group after XX days since they were registered.
      Kind Regards,
      Antonio B.

      1. Wow! This is over my head but gives me an incredible place to start and give to a developer.

        Thanks for the support.

        1. I’m glad,
          cheers

  3. Gerd Neumann Avatar
    Gerd Neumann

    After posting to the support page on wordpress.org already, I read on https://wordpress.org/plugins/groups/faq/ that questions should be rather posted here. So I just leave the link to my question (bug report?) here: https://wordpress.org/support/topic/incompability-with-woocommerce-subscriptions-problem-with-user_has_cap/

    Would be great if you could leave some feedback on this.

    Thanks,
    Gerd

    1. Hi Gerd,
      Sorry, I can not replicate this issue.
      Please check if your subscription has Groups restrictions, maybe your user has not access to this subscription.
      Also you could try to enable the WordPress debug, editing the wp-config.php and replacing the following line
      define('WP_DEBUG', false );
      with these lines
      define('WP_DEBUG', true );
      define('WP_DEBUG_DISPLAY', false);
      define('WP_DEBUG_LOG', true );

      Then try to cancel the subscription. If errors exist then a file named debug.log under wp-content folder will be created.
      Maybe you can see more data in this debug file.
      Kind Regards,
      Antonio B.

  4. Is there a way to disable the Groups plugin filter on the edit.php page for admins? I’ve found that for the WooCommerce orders page (we have the premium groups plugin for woo), page loads take almost double the time as they do with the plugin disabled.

    From an admin standpoint, I don’t need any time of groups permission checking on the wp-admin/edit.php?post_type=shop_order so I’d like to disable it. It looks like it might be Groups_Post_Access (according to my NewRelic traces), but I can’t seem to disable it.

    Any insights would be fantastic…

    1. Hi John,
      This option is not available. Really this overloadshould not occur (maybe there is a conflict with another plugin or theme). You can try to enable the ‘Administrators override all access permissions derived from Groups capabilities.’ option on Groups->Options.
      Kind Regards,
      Antonio B.

  5. Hey Antonio,

    could you please help me in the following question about Groups plugin? I’d like to set up a primary group for a user, because I want to publish post in group level, I mean the author’s primary group will be the ‘author/owner’ – in display level – not the individual person. Do you have any solution about this?

    Thanks for your replay.

    Kind Regards,
    Gabor

    1. Hi Gabor,
      sorry I don’t understand your scenario.
      If you need to create multi levels groups, remember that when you create a group from Groups->Groups you can select a parent for this group.
      Kind Regards,
      Antonio B.

      1. Hi Antonio, thanks for your replay. Let me describre my question, so I like to set a primary or default group for a user. When your plugin insert the group user relation to the database it’s sorts the list by group id, therefore I can’t solve this issue when I’m changing the groups order when I add group to a user.
        I hope it’s helps to understand the problem.

        Thanks, Gabor

        1. Hi Gabor,
          Really there isn’t a groups order option. In the get_groups function you can use the ‘order_by’ option in $args param. Maybe you can use this.
          As alternative you could create a user_meta to indicate the default user group that can be the first when the ‘groups_updated_user_group’ action is invoqued.
          Kind Regards,
          Antonio B.

  6. For support, “leave a comment at the groups plugin page.” I guess that’s here.

    I need to set content on a page (I’m using the shortcode method) that will only display if they are not in ANY groups. How can this be done?

    1. Hi Tory,
      you can use the ‘groups_non_member’ shortcode.
      Kind Regards,
      Antonio B.

  7. Hi – I am using Groups, and I used the quick access to add a group capability to a page. I have users with that group assigned to them, but when I view that page, I get a 404 error. When I’m the admin, I can see the page, so I know the URL is correct. Any “gotchas” to check that have slipped my observation?

    Thanks!
    -jason

    1. Hi Jason,
      if your user is in the group, he should see the post. If you want, you can send me dashboard admin access to antonio[at]itthinx[dot]com indicating this conversation and the posts.
      Kind Regards,
      Antonio B.

  8. Michal Windorpski Avatar
    Michal Windorpski

    Hi,
    I have two groups ‘REGISTERED’ and ‘PRO’ and user role ‘CUSTOMER’ and ‘PRO’. I just wondering if it’s possible to make when I’m adding new user and for example I will select role user as a ‘PRO’ he will be automatically added to ‘PRO’ group and if I will select ‘CUSTOMER’ user role he will be added to ‘REGISTERED’
    Thank you
    Michal

    1. Hi Michal,
      maybe this conversation can help you.
      Kind Regards,
      Antonio B.

    2. Jennifer Smith Avatar
      Jennifer Smith

      Did you get that plugin in the conversation working? It did nothing at all when I installed it, and I really need this ability because I have to map Active Directory users to roles, not groups.

      1. Hi Jennifer,
        when you install the plugin, really you don’t see anything, but when new users are registered, they are added to the groups according to their roles.
        Kind Regards,
        Antonio B.

  9. Kevin Craig Avatar
    Kevin Craig

    If User A is in Group A and they make a new page, can I have that page restricted to Group A by default?

    1. Hi Kevin,
      this option is not available. You could use the save_post hook and the Groups API to create a custom solution.
      Kind Regards,
      Antonio B.

      1. Kevin Craig Avatar
        Kevin Craig

        Thanks for the information. Do you know how I can remove my email from getting updates when people post new comments here?

        1. Hi Kevin,
          The email is yet removed.
          Kind Regards,
          Antonio B.

  10. I have this plugin installed on my WordPress site. I would like to have “group” and “wholesale” pricing for large groups who want to purchase products in bulk. With this plugin, would I be able to create a page where customers could register then login to receive special group pricing when making an order? I have Woocommerce as the shopping cart. Please let me know if this is possible and if so how would I be able to do this?

    1. Hi Lisa,
      You can use the Woocommerce Group Pricing plugin to set discount according to the user’s groups.
      Kind Regards,
      Antonio B.

  11. Hello,

    If I add no groups in the “acces retrictions” meta box, everybody can read my post.

    I would like to block all access if I add no groups in the “access restrictions” metabox, is it possible?

    Thank you,

    1. Hi Yann,
      if you don’t set group restriction to a post, the post will be free. You could use Groups Restrict Categories to set restrictions to categories, so you don’t need to set the restriction post by post.
      Kind Regards,
      Antonio B.

      1. Hello Antonio,

        Is it possible to always add by default one groupe in the groups restrictions metabox ?

        Yann

        1. Sorry, this option doesn’t exist.
          Kind Regards,
          Antonio B.

  12. Trying to figure out if there is a group leader of some kind that can restrict access to the group itself. Perhaps different roles within the group? Thanks!

    1. Hi Matt,
      Sorry, this feature is not available. Remember that from Groups->Options you can set the permissions according to the roles, maybe this can help you.
      Kind Regards,
      Antonio B.

  13. Joris Brabants Avatar
    Joris Brabants

    I really don’t see any option to add or remove an individual user to a group in WordPress User Management

    1. Hi Joris,
      above the users table you have a bulk option to add/remove users to/from groups.
      If you select ‘Show groups in user profiles.’ in Groups->Options, then when you can add/remove groups from the users profile page.
      Kind Regards,
      Antonio B.

  14. Love the Groups plugin…but you really need to work on your changelogs. They’re not very informative 🙁

    1. Hi Tony,
      thanks for the suggestion, we will consider it.
      Kind Regards,
      Antonio B.

  15. Hi antonio

    Is there a way for non registered users to see the preview of restricted posts on the home page?

    Basically all the restricted content posts are pulled into my home page as a featured image and post title but to non members its just a blank page, i need them to see the preview of the posts

    Thanks

    1. antonio Avatar

      Hi Christopher,
      you can do it using the [groups_member] and [groups_non_member] shortcodes.
      Kind Regards,
      Antonio B.

  16. Hi! I am thinking of using your plugin for my next project but I want to make sure it will do what I need first. Basically I have been asked to build a website which will have listings added by companies. The listings will only be visible to logged in Members. My plan is to use a theme like Listify (on themeforest) and BuddyPress. But I need to ensure that the Members cannot add listings and the companies cannot use the social networking facilities. I was starting to wonder how on earth I can allow access to companies to add and edit listings while ensuring that the public cannot view them without logging in first. I asked for help on the WP support forum and someone recommended your plugin. I’ve had a look and it looks promising. Will it work with Listify and Buddypress? Will it do what I need?

    Thanks
    Jen

    1. antonio Avatar

      Hi Jen,
      If the theme implements the listings as post types or taxonomies, you can use the Groups Restrict Categories with Groups.
      But that depends of the theme implementation. If you have the theme installed, you can send me dashboard admin access to antonio at itthinx dot com (indicating this conversation), and I’ll have a look at this.
      Kind Regards,
      Antonio B.

  17. Hi,

    Is there a way to have someone automatically added to a group upon registration. I have a custom registration form that adds users to a certain WP role. I need people in that role to be added to a group as well. So maybe there is a way to add a entire role to a group. Example: Add the Subscriber role to a group so that whoever is in the Subscriber role will automatically be added to the group. I hope that makes sense. I just need to know if there is a way to add a user to a group automatically.

    Thanks!

    1. antonio Avatar

      Hi John,
      I have created this code that automatically add the new user to the ‘Premium’ group. You could use this code as reference to crete your own solution with the Groups API.
      Kind Regards,
      Antonio B.

  18. Pradeep Bhat Avatar
    Pradeep Bhat

    Hi Antonio,
    Is there any Rest API to create group.I want to create group from my application?

    Thanks and Regards

    Pradeep Bhat

    1. Hi Pradeep,

      We’re currently working on that, is the API itself useful for you meanwhile? http://docs.itthinx.com/document/groups/api/

      Cheers

  19. I know about the setting to display the groups that the user is part of in their profile, but is there any way to have that info somewhere on the frontend? I don’t allow regular users to access the backend so I’m hoping for some type of a solution to let them know what group they are in on the frontend. I downloaded a plugin called User Profiles Made Easy but can’t figure out how to implement it through that. I am also using Woocommerce, is there any way to display their group in WooCommerce’s My Account page?

    Thanks

    1. antonio Avatar

      Hi Dustin,
      you can use the [groups_user_groups] shortcode.
      Kind regards,
      Antonio B.

  20. Hi!

    This plugin is almost exactly what I’ve been needing, but I can’t get past a certain glitch…

    On my site, I have several groups of “monsters” (werewolf, vampire, zombie, etc.). A user is allowed to be a member of any one group at a time, and they can change their alliance as needed. The shortcodes allowed me to build it this way:

    Choose a Creature Clan for access to exclusive content
    Note: you can only join one Creature Clan at a time. Your current Creature Clan is: [groups_member group="Ghost"]Ghost[/groups_member][groups_member group="Vampire"]Vampire[/groups_member][groups_member group="Werewolf"]Werewolf[/groups_member][groups_member group="Zombie"]Zombie[/groups_member].
    [groups_member group="Ghost"][groups_leave group="Ghost"][/groups_member][groups_member group="Vampire"][groups_leave group="Vampire"][/groups_member][groups_member group="Werewolf"][groups_leave group="Werewolf"][/groups_member][groups_member group="Zombie"][groups_leave group="Zombie"][/groups_member]

    [groups_non_member group="Ghost,Vampire,Werewolf,Zombie"][groups_join group="Ghost"][groups_join group="Vampire"][groups_join group="Werewolf"][groups_join group="Zombie"][/groups_non_member]

    So if they are a member of a group, the only choice they have is to leave the group, and if they are a member of no groups, they are offered buttons to let them choose a group to join.

    The trouble I hit is that the page doesn’t refresh after running the short code.

    So, if they leave a group, they have to refresh the page to see the new buttons. More complicating: if they CHOOSE a group, then they can immediately choose another group and another group and so on. If the page refreshed, then the shortcodes would allow only the appropriate controls to resolve.

    How might I force the page to refresh once they click any button in that group?

    1. antonio Avatar

      Hi Edward,
      The ‘groups_leave’ and ‘groups_join’ actions are executed when the shortcode is executed, and this is after your groups is displayed.
      You can try to change the order, ex:
      [groups_member group="Ghost"][groups_leave group="Ghost"][/groups_member][groups_member group="Vampire"][groups_leave group="Vampire"][/groups_member][groups_member group="Werewolf"][groups_leave group="Werewolf"][/groups_member][groups_member group="Zombie"][groups_leave group="Zombie"][/groups_member]

      [groups_non_member group="Ghost,Vampire,Werewolf,Zombie"][groups_join group="Ghost"][groups_join group="Vampire"][groups_join group="Werewolf"][groups_join group="Zombie"][/groups_non_member]

      Note: you can only join one Creature Clan at a time. Your current Creature Clan is: [groups_member group="Ghost"]Ghost[/groups_member][groups_member group="Vampire"]Vampire[/groups_member][groups_member group="Werewolf"]Werewolf[/groups_member][groups_member group="Zombie"]Zombie[/groups_member].
      [groups_member group="Ghost"][groups_leave group="Ghost"][/groups_member][groups_member group="Vampire"][groups_leave group="Vampire"][/groups_member][groups_member group="Werewolf"][groups_leave group="Werewolf"][/groups_member][groups_member group="Zombie"][groups_leave group="Zombie"][/groups_member]

      Kind Regards,
      Antonio B.

      1. Hi Antonio, and thank you for writing back.

        I had figured out the rendered-vs-active component, and I’m glad you confirmed that.

        All I’m trying to achieve is a relatively seamless “pick only one” experience.

        So, I guess I have two questions that might guide me:

        1. Is there a way to refresh the PAGE after a button is clicked (for example: if one joins a group), or at least to refresh the contents of a specific DIV which contains all the Groups HTML stuff (because it seems as if there is SOME sort of refresh activity happening), but in such a way that the contents of the DIV respect the choice that was made BEFORE the refresh event?

        2. Is there a way to use a standard JS control (button, drop-down, etc.) to perform a group action such as “add me to the Vampire group” or “delete me from the Vampire group”?

        1. The part that keeps confounding me is the changing of the display of the elements based on the choices made. There seems to be SOME kind of localized refresh happening (thus when I remove myself from a clan, my affiliation reports accurately), but if that localized refresh IS happening, why aren’t the display-rules-for-buttons applying to it?

          I rewrote the code to put the “leave a clan” button in FRONT of the clan affiliation declaration, which worked great. Once they leave a clan, their “status” changes to “unaffiliated”, which is perfect, and then they are offered the list of clans to join, which is ALSO perfect.

          But there’s something going on I can’t explain…

          I discovered that picking a clan didn’t redraw the page, which meant the “pick a clan” buttons for the other clans remained on the page.

          If I refreshed the page, everything looked fine.

          So I surrounded the cluster of “pick a clan” buttons in a DIV such that on mouseup anywhere in that DIV (such as picking a clan button), the page was redrawn.

          But that actually failed to happen (as per my first note). The EXACT SAME CODE around a word worked fine. So, that was weird.

          So then I tried simply hiding the contents of the DIV (after all, if you can’t SEE a button, you can’t click it).

          And at first, it seemed to work.

          But then it refreshed a half-second later. With the subset of “pick a clan” buttons re-appearing. In Chrome. But not in IE. In IE, it remained hidden. (so the AJAX or whatever is executing under Chrome, but apparently not executing under IE…?) (but if it IS refreshing, how come the “what group are you now in” logic isn’t working anymore?)

          1. Hi Martin,

            See also my reply on your post Post-buttonclick actions?. Basically you have a form that shows as a button which is submitted when you click it. What you describe related to the other buttons is basically because the submission is handled in the process and the shortcodes that surround the buttons aren’t “aware” of the change when they are rendered, only on the next page load. A good solution would involve appropriate Javascript which disables and hides the other buttons, probably with an AJAX handler for the buttons (forms) themselves – something you would have to customize. Maybe another option is to have a look at the Gravity Forms integration?

            Cheers

        2. I set up a test page here:

          http://www.store.hellbendermedia.com/my-account/

          I think you should be able to set up a test account to observe the behavior of the buttons.

          This is the code behind it:


          Choose a Creature Clan for access to exclusive content

          Note: you can only join one Creature Clan at a time.

          [groups_member group="Ghost"][groups_leave group="Ghost" display_message="false" submit_text="Leave the Ghost clan"][/groups_member][groups_member group="Vampire"][groups_leave group="Vampire" display_message="false" submit_text="Leave the Vampire clan"][/groups_member][groups_member group="Werewolf"][groups_leave group="Werewolf" display_message="false" submit_text="Leave the Werewolf clan"][/groups_member][groups_member group="Zombie"][groups_leave group="Zombie" display_message="false" submit_text="Leave the Zombie clan"][/groups_member]

          Your current Creature Clan is: [groups_member group="Ghost"]Ghost[/groups_member][groups_member group="Vampire"]Vampire[/groups_member][groups_member group="Werewolf"]Werewolf[/groups_member][groups_member group="Zombie"]Zombie[/groups_member][groups_non_member group="Ghost,Vampire,Werewolf,Zombie"]unaffiliated with any Creature Clan[/groups_non_member].

          [groups_non_member group="Ghost,Vampire,Werewolf,Zombie"]
          [groups_join group="Ghost" display_message="false" submit_text="Join the Ghost clan"]
          [groups_join group="Vampire" display_message="false" submit_text="Join the Vampire clan"]
          [groups_join group="Werewolf" display_message="false" submit_text="Join the Werewolf clan"]
          [groups_join group="Zombie" display_message="false" submit_text="Join the Zombie clan"]
          [/groups_non_member]

        3. Hi guys,

          The issue here is with the way the shortcodes are handled and although close, those solutions won’t work as you’d want them to. When the groups_member or groups_non_member shortcodes wrapped around groups_join or groups_leave shortcodes are processed, the latter haven’t executed the addition or removal of the user to or from a group and thus what is rendered is inconsistent with what you would expect right after you have clicked a button (submitted its form). On the next page load, it would show the appropriate buttons only. For example:

          [groups_non_member group="Test,Testing"][groups_join group="Test"][groups_join group="Testing"][/groups_non_member]
          [groups_leave group="Test"]
          [groups_leave group="Testing"]

          If you click the button to join the Test group the form is submitted and the groups_non_member shortcode will show its contents because at that stage the user hasn’t been added to the Test group yet. That is done while the group_join shortcode for the Test group is processed. As the content is rendered, the user is added to the Test group and then the groups_join button for the Testing group is rendered. For this case, it’s no good, at least not right after you have submitted the form (clicked the button).

          For your case, it would be simpler to just create a shortcode that offers a select box instead and handles the removal from the current group if the user chooses another. That’s my recommendation, you can in fact derive it easily from the groups_join and groups_leave shortcode handling code.

          I hope that helps to clarify it more. There’s much room for improvement for the way these things are handled in Groups and I hope we can offer something more versatile, son. Anyhow, would you like to try the suggestion around a select box?

  21. Hello,

    I am using groups for access restriction on a food blog. Excellent plugin, has worked like a charm. I recently installed a new recipe plugin, wp ultimate recipe (also a great plugin). I had previously been locking/showing content using short codes in the main text area box. However, the new recipe plugin includes custom post types that use many custom fields to build the ingredients and instructions for each recipe. Is there a way to lock the custom field content using short codes, without taking the time to apply the short codes to each individual field? If not, is there conditional php I can add to the custom post type template to restrict those sections?

    Regards,

    1. antonio Avatar

      Hi Kevin,
      I hope this comment can help you with the php code.
      Kind Regards,
      Antonio B.

  22. Hi Antonio,

    I have a quick, and what would seem a really simple, question but I just can’t figure out how to do it.

    I have the Groups, WooCommerce and WooCommerce for Groups plugins.

    I want any not logged in visitor to the website to be able to see the ‘Premium’ posts in search results but when they click on them to view them they get redirected to a signup page.

    Can you point me in the right direction ?

    Thanks

    1. antonio Avatar
      antonio

      Hi Tyrone,
      The search filters the restricted pages/posts. You could use the [groups_member] and [groups_non_member] shortcodes to restrict the contect instead of restrict the full page/post. So the post will be on the search results but according to the user group, he will see different content.
      Kind Regards,
      Antonio B.

  23. Hi Antonio,

    I have dug deeper into the code. Here’s what the error message is:

    Warning: Missing argument 2 for gpatf_groups_created_user_group() in /******/wp-content/plugins/groups-premium-add-to-foobar-master/groups-premium-add-to-foobar.php on line 38

    Line 38 is:

    function gpatf_groups_created_user_group( $user_id, $group_id ) {

    It seems the add_action call on line 36 needs to be told to expect two variables with two extra parameters: 10 and 2.

    add_action( ‘groups_created_user_group’, ‘gpatf_groups_created_user_group’, 10, 2 );

    When I do that, it works. You might want to update the demo. 😉

    Thanks!

    1. antonio Avatar
      antonio

      Hi Dave,
      thanks for sharing.
      Kind Regards,
      Antonio B.

  24. I have been considering this plugin for membership access to a client’s website (along with the paypal, forums and file access modules). But the problem is that they would need a group subscription based on the groups instead of the users. For example, an organisation registers, and then their employees get access through the organisation. That would technically work with the groups, but for my client some automation would be required. When an organisation registers they would need to be able to pay to increase privileges to their group, which would then grant these privileges to their members. Technically, this already works with groups, but would require a lot of manual work by the site admin (create a group for the new organisation, collect payment, then add privileges to the group, then manually assign users to the group). I’ve been testing the plugin, but it can’t seem to do this. Is there any way to do some of this automatisation that I’ve missed? Any suggestions?

    Thanks!

    1. antonio Avatar
      antonio

      Hi Dave,
      You can use the Groups API to create your own solution. You could have your groups with basic capabilities,and when you receive a payment, then add extra capabilities to this group.
      Relating to “Import/export users to/from a group”, you can do it manually or using the Groups Import/Export plugin.
      Kind Regards,
      Antonio B.

      1. Thanks for the answer, I will look into that. I’ll look into upgrading the groups capabilities according to the other groups members are part of, so if a user of the group buys access to the premium group, everyone in the group gets the same capabilities.

        Is it possible to have users that are part of a group be able to invite other users to the group? I guess it could be done with the API but its already possible I’d rather not have to code it. 🙂

        Thanks!

        1. antonio Avatar
          antonio

          Hi Dave,
          I have created the Groups Invitations plugin that you can use as reference to create your own solution.
          Kind Regards,
          Antonio B.

          1. Great! I modified it to work only on groups starting with a specific string pattern and added some obfuscation to the URL so it is not too easy to change the group id (and thus join the other groups that user is part of) and it works very well for what my client needs.

            Now I’m on to code the automatic group capabilities assignments. This solution seems very good, and most importantly, cheap for my client, since I don’t have to spend days coding a custom solution or have them pay through the roof for other membership plugins that charge crazy monthly/yearly fees for plugins that are not very good or even customizable.

            Many thanks!

            1. antonio Avatar
              antonio

              Perfect 😉

          2. Hi again,

            I tried working on upgrading groups capabilities like I stated earlier, but could not get ‘groups_created_user_group’ to trigger. To test that I installed this demo: https://github.com/itthinx/groups-premium-add-to-foobar/blob/master/groups-premium-add-to-foobar.php, added the Premium and Foobar groups and it doesn’t work. The ‘groups_created_user_group’ action still doesn’t trigger.

            Any idea?

            Thanks!

            1. antonio Avatar
              antonio

              Hi Dave,
              Maybe are you working with capabilities? Please have a look at the actions documentation page.
              Kind Regards,
              Antonio B.

              1. Yes, I’m working with capabilities, but I need to know when a user joins a group. The way I see it, when a user joins a premium group, I want to know, and I will propagate the capabilities to its other membership groups at this moment, which is why I’m working with the ‘groups_created_user_group’ action. But if you have a better idea, I’m all ears.

                Thanks!

                1. antonio Avatar
                  antonio

                  Hi Dave,
                  Maybe this plugin can be used as reference. It does something different, but you can see the use of hooks.
                  Kind Regards,
                  Antonio B.

  25. John King Avatar
    John King

    Hi, I have applied the Access Restrictions to the Media post type in Groups / Options.

    When I go to a page and click ‘Add Media’, then drag an image to the screen the Access Restrictions dropdown seems to be broken and in my console I see the error message ‘Uncaught TypeError: jQuery(…).selectize is not a function’.

    Is this a known bug? And is there a fix I can apply?

    Thanks.

    1. antonio Avatar
      antonio

      Hi John,
      I can not replicate your issue. Please be sure you have the latest versions and check if you have another plugin that could have javascript problem.
      If the problem persists, you can send me dashboard admin access to antonio at itthinx dot com, indicating this conversation and I’ll have a look at your settings.
      Kind Regards,
      Antonio B.

  26. Facemweb Avatar
    Facemweb

    Hi,

    Is it possible to remove all the users of a group instead of making it user by user ?

    1. antonio Avatar
      antonio

      Hi Facemweb,
      From the Users->All users page you can select multiple users and uses the bulk actions.
      Kind Regards,
      Antonio B.

      1. Facemweb Avatar
        Facemweb

        Didn’t see that option !!
        Thanks !

        1. antonio Avatar
          antonio

          Hi,
          You should have these fields.
          http://i65.tinypic.com/rs5y0h.png
          Kind Regards,
          Antonio B.

          1. Facemweb Avatar
            Facemweb

            Works great
            Thank you

  27. Martijn Avatar
    Martijn

    Can this plugin also be used to limit the pages that are editable by a group ?

    case: a couple of user filled pages, were a couple of blogs and events are automaticly placed, but the group “owner/leader” should be able to edit this page. But he/she has no business editing any of the other pages. Can I use this plugin to make an editor, who is part of group A, only able to edit the page of group A?

    Kind regards,

    Martijn

    1. antonio Avatar
      antonio

      Hi Martijn,
      If you restrict a post/page to a groupA, and your editor user is not in this group, then he can not view/edit this page/post.
      So you could restrict all your pages to a ‘editorGroup’. Create an ‘ownerLeaderGroup’ and assign the pages editable to this ownerLeaderGroup.
      If you need to have editors who can edit all pages, the join these editors to both groups: editorGroup and ownerLeaderGroup.
      Kind Regards,
      Antonio B.

  28. Hi !

    Is it possible to not hide a menu when the user doesn’t have the correct permission ? Just display a message on the page like “Sorry, you do not have the correct permission”.

    Thanks 🙂

    1. antonio Avatar
      antonio

      Hi Loic,
      You can do it using shortcodes in the page/post content, instead of limit the full page/post.
      Kind Regards,
      Antonio B.

  29. Hi,

    We want to use groups to limit access to several pages/content.
    But there is one thing we want to do, were we don’t see any options for, so I don’t know if it can be done with this plugin or with any of the addons. So maybe someone here can help us out.

    For a couple of the groups we would like to have a specific group page, were some info for this group is displayed. Users can be in multiple groups.

    Is there a way to only display the pages the user has access too in a menu, preferably in the submenu.
    exaple : User X is part of group A,C & G
    So user X sees:
    grouppages
    -group a
    -group c
    -group g

    & user Y is part of group D & G and sees
    grouppages
    -group d
    -group g

    I hope its clear what we would want.
    Is this possible within this plugin and or its addons? or do we have to find another solution.

    Kind regards,

    Martijn

    1. Hi Martijn,

      If you add a restricted page to a menu through Appearance > Menu > Pages the menu item will only show up if the user has access. This works with protected posts, too, note that it will have no effect if you add a URL directly using Custom Links.

      Cheers

      1. Martijn Avatar
        Martijn

        Thanks, works like a charm.

      2. Cloudfusion Avatar
        Cloudfusion

        Hi, I have custom links in my menu used as seperators, how can I hide these links using Groups? or Is there any other solution / idea to implement this to work with Groups? Thanx!

        1. antonio Avatar
          antonio

          Hi Cloudfusion,
          you can use the Menu Item Visibility Control plugin using this code: current_user_can(‘your_capability’);
          Regards,
          Antonio B.

  30. First off, fantastic plugin! Groups has really been helpful, so thank you!

    But I seem to have a strange issue. I’m using Groups to show/hide posts based on membership. However, if I make a post sticky, it shows up on the posts page even though the user doesn’t belong to that group. If you try clicking into the post, you get a 404, which is good. But I need to stop a sticky post from being listed on the posts page.

    Is marking a post sticky supposed to override Groups or am I just missing something here?

    Thanks!

    1. Hi Eric,
      Sticky posts override Groups, but you can use this code if you need to filter the sticky posts.
      Kind Regards,
      Antonio B.

  31. Maxident Avatar

    Hi Kento,

    I am thinking about buying the groups file access plugin. As far as I understand file restriction works based on the group membership only. Is there a way to add a password request before the file can be downloaded if the member is part of a group that is linked to the file?

    I am not sure if membership alone is enough security.

    cheers

    1. Hi,

      The user has to be logged in to access the file or use a specific link, otherwise it will not be accessible. There’s no additional password option to access the file, it’s not something that I would consider adding as I consider the plugin’s restriction already sufficient, but thanks for asking.

      Cheers

  32. Your plugin says that it can restrict access to custom types of media. For instance the access restrictions option comes up in my media library, if I apply a restriction to the media I find that it does not work. If i type the web address into a browser of which I am not logged into my site I go directly to that document. What I really would love is a way to completely lock down media/files using groups. Any help you can provide is appreciated.

    1. Hi Marcus,

      That’s correct, the attachment page itself is protected but if you have the direct URL to the file it will still be accessible. You can protect files using Groups File Access, please have a look also at the documentation so you can see if that would be suitable for your requirements.

      Cheers

  33. I have the plugin installed and set-up nicely, but I want to protect the page behind a payment wall and only allow visitors to sign up for a membership then they can access.

    Can someone help me by going into my WP dashboard?

    1. antonio Avatar

      Hi,
      If you are using Woocommerce, you can use Groups Woocommerce to sell access to groups. So only users who purchase “this product” have access to the protected pages.
      Kind Regards,
      Antonio B.

    2. whoaloic Avatar
      whoaloic

      OK thank you for the answer. Do you know an alternative of default WordPress category widget to count post according to user group and post restrictions? Any help would be really appreciated.

      1. antonio Avatar

        Hi Whoaloic,
        This code should fix this count. You need to add this in your functions.php child theme file.
        Kind Regards,
        Antonio B.

  34. whoaloic Avatar
    whoaloic

    Hello,
    I still have a wrong counter in my post widget according group capability.
    Is there a way to get the correct number of posts? For now, it includes all posts but I would like to be only included posts with groups capabilities according to user logged in.
    Best wishes.

    1. antonio Avatar

      Hi Whoaloic,
      Sorry for the delay. Just as wordpress widgets work, it is not possible to modify that counter.
      Kind Regards,
      Antonio B.

  35. I need access-protected posts to be visible on category pages (or any page that uses the $wp_query variable).

    I found the relevant code in the plugin directory /groups/lib/access/class-groups-post.access.php, in the function posts_where (there is a mySQL statement that pulls posts which aren’t protected or which the user doesn’t have the capability to access.

    Instead, I want all the posts to be visible, but if a user clicks on them, I want the posts to remain access protected.

    What adjustments can I make to the posts_where function, in order to accomplish this?

    1. antonio Avatar

      Hi JoC,
      maybe Groups Excerpts can be a solution.
      Kind Regards,
      Antonio B.

  36. Hi – i cant find a way to lists the users in a particluar group, on the front-end?

    1. Hi Sam,
      you can use this plugin and use the [groups_users_list_group] new shortcode, with the ‘group_id’ attribute.
      Kind Regards,
      Antonio B.

      1. This plugin does not seem to work anymore, but you can use the Groups shortcode [groups_group_info group="Group Name" show="users"]

        1. Hi Dennis,
          that’s true, thanks !!

  37. We have Group Plugin on the website and we have around 1000 groups live for Access restrictions.

    The issue is when we have Groups plugin active with 1000 Groups, we are not able to load the images under the Add Media window quickly.

    Is anyone have idea how can we fix this issue????

    1. Hi,

      I don’t see where this would affect the Media > Add New screen, the access restrictions aren’t even listed there so I’d like to find out why this is creating an issue for you on your site. Do you get any Javascript errors?

      Cheers

  38. Hi

    I am looking to see if the Groups membership plugin would allow me to do the following:

    Example: John Smith (member) logins into the site, and he can only see posts that have been assigned to him. No one else would see this posts.

    Would I need other extensions or custom coding to do that?

    Thanks

    1. Hi Keith,

      With Groups you can grant access to members of a certain group, so in this case, you would protect the pages and then assign John Smith to the group that has access. See Access Control in the documentation for details please.

      Cheers

  39. Juliette Avatar
    Juliette

    Hi Itthinx team,

    Do you sell plugin’s group which allows to hide or to show different menus according to the group of the users ?

    Thanks
    Juliette

    1. antonio Avatar

      Hi Juliette,
      you have available this plugin that you must customize it.
      Kind Regards,
      Antonio B.

      1. Juliette Avatar
        Juliette

        Hi Antonio,

        I’m talking about premium plugin that I can buy to you… :))

        But If you have a free plan…
        How can you do to install this file ? You install it in folder in /plugins/ ?

        Sorry I’m not developper… :oS

        1. antonio Avatar

          Hi Juliette,
          maybe this solution is easier for you, please have a look at this conversation.
          Kind Regards,
          Antonio B.

  40. Brian Russell Avatar
    Brian Russell

    Is there any way to get a multisite install to recognize group affiliation across the multisites? If I wanted a specific group to have access to that group’s access across the whole network?

    That would be incredibly helpful.

    1. Hi Brian,

      Thanks for asking, this isn’t possible yet altough we’re already aware of the usefulness and should be providing a solution hopefully soon. See this topic for example.

      Cheers

  41. Hi,

    I have a site where there are many groups and subgroups and inherited capabilities. I am able to restrict access to pages or posts to a certain group or subgroup just fine.

    My question is how would I go about excluding access to a page or post for a specific group without having to list all the others that do have access?

    Thanks.

    1. Hi Andrei,

      That’s a good question – in fact there are plans to add the possibility to exclude certain groups from being able to access a page, but currently it won’t be possible … maybe using the [groups_non_member] shortcode is a solution meanwhile? You can use it to enclose content on a page so that it is hidden from group members. If the page itself it protected, then that could work. Also note that you would have to combine it with the [groups_member] shortcode enclosing that section so that those who shouldn’t have access can’t see it either (if the page isn’t restricted).

      Cheers

  42. Hi

    I use Groups to grouping my authors and I found an editor for any group.
    Now I want to add group filter to posts page to filter the posts by group.
    Is there a way for this issue?!

    Thank you

    1. Hi,

      Thanks for the suggestion, currently there is not filter to show posts by authors’ group membership but it sounds like a useful idea. Maybe we can add this later on.

      Cheers

  43. Hi-

    I’m looking for a way (possible a small snippet added to my theme’s functions.php file) that would allow me to redirect a particular link or page to another url/page on my site based on the logged in user’s group or capability. More specifically, I’m looking to redirect a generic URL (call it https://mysite/dashboard) to one of several other urls based on a user’s assigned group.

    Any ideas?

    Note that I’m NOT just trying to redirect after login. I’m trying to systematically redirect a particular link…

    Thanks in advance!

    1. Hi Karl,

      I would probably go about this in a similar way as used by Groups 404 Redirect – hooked on the wp action and using the Groups API to check to which group a user belongs (see Examples). Does that help?

      Cheers

  44. Sophie Jones Avatar
    Sophie Jones

    Hello
    Is there any way to allow a user to manage one group, in a sense be the owner of that group and allow him to add sub-groups to his group if necessary without giving them major global permissions??
    Basically, I would like to be able to create the parent group for privileged role users and give them owner of the group and allow them to create subgroups in this group??
    My goal is to create a page using group shortcode and show list of users in this group with a custom field in their profile to show if they are available or not. So the owner/manager of this group can see, and add a button to open a form to create subgroup where he can add from users who are available and create his subgroup which he can later use on a custom post type.

    1. Hi,

      Thanks for asking – it’s possible to create a group with administrative permissions for the Groups section itself, but it wouldn’t be possible yet to limit these to allow only subgroups to be managed by someone. We’re working on a more fine-grained permission model but it isn’t available yet.

      Cheers

  45. Is it possible to restrict the edition and creation of article, of a certain cartegory to a certain group of admin ?

    I see how to restrict categories to users, but I’d like do to the same with administrators.

    1. Hi,

      You can protect the category – if the user who is publishing the post doesn’t belong to a group that has access to the category, then it won’t be available to that user. Does that work for what you have in mind?

      Cheers

  46. When a Woocommerce subscriber cancels their membership they are removed from all groups. How do I set it so they will automatically be placed in the Registered group upon cancellation?

    1. Hi Jerry,
      by default new users are in ‘Registered’ group, so you don’t need to select the ‘Registered’ group in your subscriptions.
      Kind Regards,
      Antonio B.

      1. I thought that was the case as well however it was brought to my attention today that when a subscription is canceled the member is removed from all groups and they cannot see anything within the [groups_member group="Registered"]…[/groups_member] shortcode until I manually put them back in the Registered group. I also noticed that they are automatically assigned to the Registered group if I deactivate and reactivate the groups plugin. My question is, “Is there a way to make assignment to Registered group upon downgrade automatic without having to deactivate and reactivate the plugin?” Thanks so much for everything. I think your work is pretty amazing!

        1. Hi Jerry,
          what subscription plugin are you using ? Woocommerce Susbcription? So I can test this (If you want, you can send me dashboard admin access to antonio at itthinx dot com indicating this comment, and I’ll have a look at your settings).
          Kind Regards,
          Antonio B.

  47. I just solved my own question. It was a silly mistake with a simple answer. I was using the name of the ‘capability’ in the Groups shortcode instead of the name of the ‘group’ itself. Once I made that change, everything worked as expected.

    Thanks for a great plugin!

    1. Perfect 😉
      Kind Regards,
      Antonio B.

  48. I have been using the Groups plugin for around a year and it has worked great. Today I tried something that seemed very straightforward, but it is not working as expected.

    My problem involves two groups.

    GM Group
    Capabilities…
    – groups_read_post
    – access_all_shops

    Owner Group
    Capabilities…
    – groups_read_post
    – access_all_shops
    – access_shop_owners

    The WP users in question are assigned to either the ‘GM’ or ‘Owner’ group.

    I created a post that I gave an access restriction of ‘access_all_shops’.

    Inside that post I have several download link shortcodes (from WordPress Download Manager Pro). For one of these shortcode links I have added the Groups shortcode access restriction of ‘access_shop_owners’. It looks like this…

    [groups_member group="access_shop_owners"][wpdm_package id=’1060′][/groups_member]

    Expected Behavior
    The post would be accessible only to ‘Shop’ users but the one download link would only be seen by the ‘Shop Owners’.

    Actual Behavior
    The post is accessible only to ‘Shop’ users, but the one download link is hidden to everyone?

    What do I need to do to achieve the ‘Expected Behavior’? Thank you for your help.

  49. Suman kalyan mohanty Avatar
    Suman kalyan mohanty

    Hi again

    It’s working good after putting that code in functions.php.But now users are added to both registered and the group I created i.e vets, at the same time. How can I added the users to only “vets” group.

    I dont users to be added to registered groups.Please let me know as thisi s my client’s requirement.

    Thanks
    Suman

    1. Hi Suman,
      ‘Registered’ is the default group, it can not be removed. But it should not be a problem, simply limit your contents to the VET group.
      Kind Regards,
      Antonio B.

      1. Suman kalyan mohanty Avatar
        Suman kalyan mohanty

        Thanks a lot for the heads up 🙂

  50. Suman kalyan mohanty Avatar
    Suman kalyan mohanty

    Hi Antonio

    I m just using this plugin and it’s working good.
    All the users are automatically added to registered group by default.I want users to be added to my own created groups(eg:VETS,a group I created).
    Please let me know how to do that?
    Hope for a quick heads up.

    Regards
    SUman

    1. Hi Suman,
      you can use this code in your functions.php theme file. You need to change ‘Premium’ for your group’s name.
      Kind Regards,
      Antonio B.

      1. Suman kalyan mohanty Avatar
        Suman kalyan mohanty

        Hi again

        It’s working good after putting that code in functions.php.But now users are added to both registered and the group I created i.e vets, at the same time. How can I added the users to only “vets” group.

        I dont users to be added to registered groups.Please let me know as this is my client’s requirement.

        Thanks
        Suman

Leave a Reply

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

Share