Groups

groups-512x512
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.


Extensions

New Groups Restrict Categories and Groups Import Export.

  • Groups 404 Redirect allows to redirect visits to pages that are protected by Groups.
  • Groups Blog Protect restricts access to blogs based on group membership.
  • Groups File Access Groups File Access is an extension that allows to provide file download links for authorized users. Access to files is restricted to users by their group membership.
  • Groups Forums provides a powerful and yet light-weight forum system for WordPress sites.
  • Groups Gravity Forms allows to add users to groups automatically, based on form submissions.
  • Groups Import Export – An import and export extension for Groups.
  • Groups Jigoshop Groups integration for Jigoshop that supports memberships and subscriptions.
  • Groups Newsletters helps you to communicate efficiently, providing targeted information to groups of recipients through automated campaigns.
  • Groups Notifications allows to send automatic notifications to group members and the site administrator.
  • Groups PayPal – Sell memberships and subscriptions with Groups and PayPal.
  • Groups Restrict Categories features access restrictions for categories, tags and other WordPress taxonomies, including support for custom post types and taxonomies.
  • Groups Restrict Comments Pro This extension for Groups allows to restrict who can post or read comments based on a user’s group membership.
  • Groups Subscriptions is a subscription framework for Groups.
  • Groups WooCommerce Groups for WooCommerce is a WordPress plugin that allows you to sell memberships.
  • WooCommerce Group Coupons This extension for WooCommerce uses Groups and WordPress roles to limit the validity of coupons.
  • WooCommerce Groups Newsletters The WooCommerce Groups Newsletters extension lets customers subscribe to newsletters at checkout.


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

  • 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: [groups_member], [groups_non_member]
  • control access to content by capabilities: show (or do not show) content to users who have certain capabilities Shortcodes: [groups_can], [groups_can_not]

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

  • administrator overrides can be turned off
  • optional tree view for groups can be shown only when needed
  • provides its own set of permissions
  • cleans up after testing with a “delete all plugin data” option

Access Control

Groups defines some capabilities of its own. The groups_read_post capability is used to restrict access to certain posts or pages to groups (and users) with that capability only.

Framework

  • 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

Your opinion counts

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 do so here at the Groups plugin page.

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!

Twitter

Follow me on Twitter for updates on this and other plugins.

Introduction

Content Access Control

Access restrictions on posts

On posts an pages (and custom content types) a new meta box titles Access restrictions appears. By checking Enforce read access, you can restrict access to the post to groups and users who have the groups_read_post capability. You need to assign this capability to a group and make users members of that group to allow them to see those posts.

Content visibility for members and non-members

The [groups_member] and [groups_non_member] shortcodes are used to limit visibility of content to users who are members of a group or users who are not members of a group. Multiple comma-separated groups can be specified.

Example: Limiting visibility of enclosed content to registered users.

[groups_member group="Registered"]

Only registered users can see this text.

[/groups_member]

Content visibility based on capabilities

The [groups_can] and [groups_can_not] shortcodes limit visibility of enclosed content to those users who have the capability or those who do not have it. Multiple capabilities can be given.

Example: Showing enclosed content to users who can edit_posts (standard WordPress capability).

[groups_can capability=”edit_posts”]

You can see this only if you have the edit_posts capability.

[/groups_can]

Integration in the ‘Users’ menu:

Users – group membership is managed from the standard Users admin view. Users are automatically added to the Registered group. You can add multiple users to other groups here and also remove them.

Sections in the ‘Groups’ menu:

Groups

Here you can:

  • add groups
  • remove groups
  • assign capabilities to groups

Capabilities

This is where you add, remove and manage capabilities.

Capabilities can be assigned to groups and users (1). These capabilities include the standard WordPress capabilities but you can also define additional capabilities for your web-application.

Groups defines some capabilities of its own. The groups_read_post capability is used to restrict access to certain posts or pages to groups (and users) with that capability only.

(1) Assigning capabilities to users is not integrated in the user interface yet but can be done through API calls.

Options

Administrator override :

Administrator overrides can be turned off.

Permissions :

For each role these permissions can be set:

  • Access Groups: see information related to Groups.
  • Administer Groups: complete control over everything related to Groups.
  • Administer Groups plugin options: grants access to make changes on the Groups > Options admin section.

Testing the plugin :

A convenient option is provided to delete all data that has been stored by the Groups plugin. This option is useful if you just need to start from fresh after you have been testing the plugin.


Shortcodes

Please visit the documentation page on shortcodes for up-to-date information: Groups Shortcodes


Download

Download the Groups plugin on WordPress.

1,432 comments

  • Jerry

    I apologize in advance for my inability to decipher the API. Unfortunately I’m very new to it and don’t know what to look for much less apply. I have a group titled Premium. How do I use the API to restrict access within my theme? Specificity would be greatly appreciated. Is it anything like:
    Restricted content Public Content

    TIA

  • Steve

    Hi, I’m using both Groups and WooCommerce Groups. I’m using the combination to limit access to specified posts to Members. I have a “Recent News” area on my home page that lists posts in specified categories. Some of them are for members only, some open to everyone.

    Is there a way to show an “indicator” that informs the site visitor a specific link is for “Members Only?”

    Right now, I’m using the Groups 404 Redirect. If they click on it, they are directed to the “hey, you need to be a member” page. But displaying an indicator would be ideal.

    Imagine something like this…
    http://mtac.spidercreations.net/wp-content/uploads/2015/02/member-content.jpg

    Suggestions?

  • Nate

    I’ve installed the Groups plugin. When I create a new post using shortcodes to control content visibility the shortcodes show up in the wordpress new post notification emails.

    [groups_non_member group="vip"]

    [/groups_non_member]

    • What plugin are you using to produce these emails? The plugin seems to skip the shortcode evaluation of WordPress when it prepares the content it is sending. Unless that’s intended, it’s a bug in that plugin.

  • I am using this plugin to restrict access to mandarin lessons on my site. We have three courses and students register for ten week classes covering one of the courses. For example, the course name is “ML1″ and the class name is “2015/2A-ML1″. Corresponding to the classes there are groups with the same name (eg “2015/2-ML1″) with a parent named “ML1″. In order to verify access privilege, we hope to check if the user is a member of the parent group (eg “ML1″). I thought that Groups_Access_Shortcodes::groups_member() would provide this functionality, but it does not. I can probably hack something together, but it seems like there must be some useful API that you guys are already exposing. Thanks for the great plugin! — especially if I can get this feature to work.

    • Hi,

      Sure, please have a look at the API section of the documentation. Many thanks for your feedback on the plugin and don’t hesitate to ask if you have questions on the API usage.

      Cheers

  • I am puzzled about the purpose of a parent group. I would expect that adding a user to a group, would automatically add them to the parent group. But this does not seem to be the case. This feature is desirable in my application (providing Mandarin Chinese classes, where multiple classes share the same online materials, but have different groups of students). So I decide to add the feature by hooking the ” action.

    [code]
    function groups_created_user_group($user_id, $group_id) {
    $group = Groups_Group::read( $group_id );
    $parent_id = $group->parent_id;
    if (!empty($parent_id)) {
    Groups_User_Group::create( array( ‘user_id’ => $user_id, ‘group_id’ => $parent_id) );
    }
    }
    [/code]

    So I have two questions
    1) What is the parent ID for?
    2) It there a better way to make it work?

    Thanks

    • antonio

      Hi,
      user is not automatically added to the parent group, but capabilities are inherited. So if you create as ‘Alumns’ group with capability ‘alumns’ and a ‘Chinese’ group (with ‘chinese’ capability) with parent ‘Alumns’.
      If you have a restricted post to ‘Alumns’, this can be readed by ‘Alumns’ and by ‘Chinese’.
      If you have a restricted post to ‘Chinese’, this can be readed by ‘Chinese’ but not by all ‘Alumns’
      chees

  • When I’m logged in as a paid/premium user (i use the woocommerce extension), I can see the content within the groups_non_member shortcode. I’d like this to be hidden so that it’s only shown to non-members and people not logged in. Why is it still showing?

  • Dave

    Is there some way to expand WP registration that integrates well with “Groups”? I’d like to be able to use an expanded registration plugin with Groups instead of trying to use S2 Membership which doesn’t play nicely with Woocommerce.

    TIA.
    Dave

  • Bobby Small

    Looks like I figured it out. i didn’t realize you had to put the group name in the not_member shortcode too :)

    • Adrian

      OMG I just spent 4 hours trying to do the same thing!! Thanks for posting your findings! If it wasn’t for me reading your post I would have never known.. Who would have thought you had to include the group name in the not_member shortcode too! You would think this would be clearly stated on this page.. Anyway many thanks!

  • Tim

    Is there a way to have access controls be disabled automatically for non-public post types? I have several hierarchical private custom post types with thousands of posts each, and having access controls on edit.php really slows down page load time (I’ve made the post types public and disabled access controls, just to see the difference). The options page currently only shows public post types.

  • Artus

    Is there a way to add pagination and search in a fronted displayed list of users? or can someone explain how to do it?
    Thanks.

  • Jack

    Hi,
    I’m wondering why this wont work.

    Content is shown regardless of group membership.
    I need to restrict content at a theme level, I’m unable to find how this can be done in the documentation.
    Thanks in advance,

  • Tim

    Can you please either disable access controls on private post types by default, or give us the ability to control which post types receive access controls via the options page?

    • Thanks for asking Tim but you already have that option under Groups > Options :)

      • Tim

        We don’t though. Private post types don’t show up in this list, but access restrictions are on by default for them. The problem is line 226 of lib/admin/groups-admin-options.php which only pulls in public post types for the list of checkboxes. There’s no way to deselect private post types.

  • Are there any easy ways to show widgets based on user groups / conditions?

    • Hi Wayne,

      Thanks for asking, I’ve replied already on Twitter but since you’ve already posted here and it’s a good question:

      Currently it’s not implemented as an option on the admin user interface, you would have to implement it using Groups’ API and a way that allows to show widgets based on conditions such as https://wordpress.org/plugins/widget-logic/ – I think it lets you evaluate code directly so you wouldn’t have to implement the whole logic behind it …

      Cheers

  • Janelle

    When using get_posts($args); the private posts disappear from the loop. Is there a way / loop to show the posts as a title list but get restricted when they access the main post page?

  • Dan

    This plugin looks as if it’s very easy to use, but I there are 2 features I would love to see:

    1. Ability to manage/group users at the Super Admin level under the Network Admin area
    2. Ability to create groups based on user meta (NOT just capabilities)

    • Hi Dan,

      Thanks for the suggestions. I agree with #1 and would like to see that, too. For #2 could you explain a use case for that please?

      Cheers

      • Dan

        For suggestion #2: I have users being registered and choosing a specific day of the month. The Day of the Month field is created by using custom user meta. I would like to create different user groups based on the Day of the Month. A user that is registered with the value of 1 would be in the Day One group, the user that is registered with the value of 2 would be in the Day Two group, and so on. The end goal is to sync each group with a Mailchimp or Constant Contact list.

        Also, is suggestion #1 in the development?

  • Jade

    Am I doing something wrong? Please help.

    [groups_can capability=”info”]
    My group members have info capability but they can not see this.
    [/groups_can]

    And:
    [groups_non_member="Registered"]
    Every user can see this. My registered users can see this text.
    [/groups_non_member]

    I tried different combinations but nothing works:

    [groups_can capability=”edit_posts”]
    I gave my group edit_posts capability. It did not work
    [/groups_can]

    And:
    [groups_member group="1"]
    It did not work.
    [/groups_member]

    • Hi Jade,

      Here’s an example you can use, you need a Donut group that has the donut capability and the user viewing the page should be logged out or logged in and be a member of the Donut group:

      [groups_can capability="donut"]
      You can donut.
      [/groups_can]

      [groups_non_member group="Registered"]
      You're not logged in.
      [/groups_non_member]

      [groups_member group="Donut"]
      You're in the Donut group.
      [/groups_member]

      Cheers

  • Margit

    I have differnt woocommerce products for members and non-members.
    I would like for my member to no longer see the products for non-members.
    Is this possible?

  • Any idea how display different menu items in the nav based on what group the member is assigned to? Would really love this functionality.

  • We have an issue of needing to restrict number of times a user gets access to a page (to view paid content). Is this in anyway possible to restrict? To put a “number of credit” on a group, so when credit is reached/used up membership of the group ends.

    Regards,
    Mette

    • antonio

      Sorry,
      this feature is not available in the plugin. If you need to create your own solution, you have available Groups API.
      cheers

    • Hi Mette, it’s an idea worth exploring. What kind of content do you want to restrict access to? I’m asking to see if the content container or storage mechanism could be used to limit the number of times it can be viewed, or if it’s necessary to leverage a (currently unavailable) feature in the Groups framework.

  • Nigel

    I’ve set up a product, created and allocated a group to it, but when payment is completed, the membership is not assigned to the user. What could be wrong here?
    Thanks

    • antonio

      Hi,
      please be sure you have ‘Processing’ as ‘Add users to or remove from groups as early as the order is …’ in Woocommerce->Groups.
      cheers

  • Chris

    I am trying to use the groups plugin shortcodes to create ‘teaser’ pages that either

    1)show a snippet to logged in users not in the specific group or non logged in users
    or
    2)completely different text to those in the nominated group.

    This works fine for users logged and shows the page differently on the user group membership but displays nothing for casual browsers.

    I have been through the docs. What am i missing here…

Leave a comment

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

*

Please follow the Support guidelines.

Premium Support is available for customers in the Forums.