Your cart is currently empty!
Groups
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”
Hello,
How can I see sales report by user group? My client says that he could do it before but he can’t now, and I’m not seeing anything of this functionality anywhere. Maybe we have to activate something else?
Regards!
Hi Victor,
I’m afraid that sales reports by user group is something that is not supported by Groups plugin so far and in order to provide this feature, it needs to be implemented from scratch. Also worth mentioning is that with the latest versions of WooCommerce, reports are provided via the Analytics section which I’m not sure if it is extensible even at its current version.
Still though, your idea has potential and it is worth reviewing, thanks for your feedback.Kind regards,
George
Hi –
A handy extension for Groups would be to provide 2 levels of pricing for a Woocommerce product, e.g. member and non-member of specified groups.
Is something like this in the pipeline? I am using Groups with Woocommerce Subscriptions to run a membership site and am looking at providing tiered pricing for a course they run.
Thanks,
Barry
Hi Barry,
Thanks for sharing your idea with us, but perhaps you should have a look at Group Coupons premium addon.
All your visitors will see the default price for each product, but specific group(s) members can use a coupon discount. This coupon will be restricted to the group(s) specified and the coupon can be added to cart either manually or automatically.Kind regards,
GeorgeHi George,
Thanks for the reply. I hadn’t seen that addon, so I will check that out and see if it works.
Regards,
Barry
Hey Barry, you’re welcome.
Sure have a look and if you need additional information on the addon, let me know.
Cheers
I am reaching out to understand if I can manage group courses for restaurants with multiple locations and managers.
Below are the specific requirements and questions I have:
Scenario:
I am selling food handler courses to restaurants with multiple locations and managers. I need a solution that allows me to:
1. Sell Group Courses: Enable restaurants to purchase courses in bulk.
2. Accurate Billing: Bill restaurants only for the courses that are completed.
3. Group Management: Allow restaurants to manage their own groups, including adding and removing participants.
4. Integration: Use LearnDash or WooCommerce for selling courses and manage groups through Group Registration plugin.
Questions:
1. Selling Group Courses:
○ How can I set up group courses in LearnDash or WooCommerce to allow bulk purchases by restaurants?
○ Can I use Group Registration to facilitate bulk purchases and manage group enrollments?2. Accurate Billing:
○ How can I ensure that billing is accurate and only reflects completed courses?3. Group Management:
○ How can restaurants manage their own groups, including adding and removing participants, using Group Registration?4. Integration:
○ What are the steps to integrate LearnDash or WooCommerce with Group Registration for seamless group management and billing?
Are there any specific settings or configurations required to ensure smooth operation and accurate billing?Hi Travis,
Thanks for reaching out with your questions. I think that WooCommerce is the right choice here and you can use our Groups WooCommerce integration to cover your requirements up to a certain point. But I think that some of the functionality you seek will need customized development, so I would highly encourage you to seek help from a developer who is familiar with WooCommerce and Groups. Groups and its extensions provide an appropriate API that a developer can use to extend functionality according to specific requirements.
Cheers!
Hello,
I’m looking to list the ‘User Groups’ the customers are assigned to, into the WooCommerce New Order emails sent to Admins.
I have already added custom data (into the functions.php file), to display username & ID into these emails, using this code:
/**
* @snippet Add customer username and ID to WooCommerce emails
*/
add_filter( ‘woocommerce_email_customer_details_fields’, ‘add_user_id_to_woocommerce_emails’, 10, 3);function add_user_id_to_woocommerce_emails( $fields, $sent_to_admin, $order ) {
$user_id = $order->get_customer_id();
$user_info = get_userdata( $user_id );$fields[‘user_id’] = array(
‘label’ => __( ‘User ID’, ‘woocommerce’ ),
‘value’ => $user_id
);$fields[‘username’] = array(
‘label’ => __( ‘Username’, ‘woocommerce’ ),
‘value’ => $user_info->user_login
);return $fields;
}——————
I found these links, but I can’t seem to get it working?
https://docs.itthinx.com/document/groups/shortcodes/groups_user_groups/
https://docs.itthinx.com/document/groups/api/examples/Hi Rachel,
You can use this to obtain the group objects for a particular user and use those to render the group info:
$group_names = array();
$groups_user = new Groups_User( $user_id );
$groups = $groups_user->get_groups(); // see class-groups-user.php
foreach ( $groups as $group ) {
$group_names[] = $group->get_name();
}
You could then use that to render the group names for your new field.
Happy coding!
Thanks Kento for your reply. Just to confirm, including this snippet in the functions.php file will do the trick?
/**
* @snippet Add customer username and ID to WooCommerce emails
*/
add_filter( ‘woocommerce_email_customer_details_fields’, ‘add_user_id_to_woocommerce_emails’, 10, 3);function add_user_id_to_woocommerce_emails( $fields, $sent_to_admin, $order ) {
$user_id = $order->get_customer_id();
$user_info = get_userdata( $user_id );$fields[‘user_id’] = array(
‘label’ => __( ‘User ID’, ‘woocommerce’ ),
‘value’ => $user_id
);$fields[‘username’] = array(
‘label’ => __( ‘Username’, ‘woocommerce’ ),
‘value’ => $user_info->user_login
);return $fields;
$group_names = array();
$groups_user = new Groups_User( $user_id );
$groups = $groups_user->get_groups(); // see class-groups-user.php
foreach ( $groups as $group ) {
$group_names[] = $group->get_name();
}}
No this won’t work, you’re adding the example I’ve given as unreachable code after the return statement and you’re missing the point of the filter. You need to provide a field definition and use the information about the retrieved groups there. It seems that you’re not quite familiar yet with how to work with filters, so I would encourage you to read up a bit on this before you proceed.
Some helpful resources:
https://woocommerce.com/document/introduction-to-hooks-actions-and-filters/
https://woocommerce.com/posts/how-to-customize-emails-in-woocommerce/
https://www.wpbeginner.com/glossary/filter/
https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-emails.html#source-view.558
https://stackoverflow.com/questions/41986388/how-to-change-woocommerce-customer-details-labels-in-emailSo, you can’t just add the code example I’ve provided, you will need to add a field definition that uses the data and then use that in the template.
I hope that helps you further.
Hello,
I wish to create different customer roles for WooCommerce with this Plugin, to help manage orders. It did work well, I created a custom role and designed a subscriber to it for testing.
On the WooCommerce Orders page, I wish to filter orders by groups, to see only orders concerning subscribers that have this specific custom role.
Sadly, when I process the research, it doesnt show anything, no order at all. Maybe it is a bug ?Thank you for your answers
Hi,
You seem to be confusing roles and groups. The Groups plugin does not manage roles, it manages specifically groups to which users can be added. I would recommend to review https://docs.itthinx.com/document/groups/memberships/ to familiarize yourself with how the plugin handles users and their group memberships.
Regarding the filtering of orders by group memberships, when using Groups WooCommerce, the orders page allows to filter orders based on products which grant memberships.
Cheers
Hi
I updated the plugin recently and now the groups still exist and if I check them individually they still have the same number of members and all, but when I use the filter it shows (0) members for all of them. Version of WordPress is 6.4.2 and of the plugin is version 2.20.0.
Thanks
Hi Sara, thanks for pointing out the issue! Version 2.20.1 has just been released which fixes that. Cheers!
Amazing, thank you!
We are using your plugin on a client’s website. They notified us this afternoon that customers logging into the front end and admins trying to log into the wp admin received an error “There has been a critical error on this website. Please check your site admin email inbox instructions”
We enabled debug and this is the error. Any ideas??We did apply the groups plugin update.
But still get this error as soon as we activate the ACF plugin. We get this when we try to login to the site:Fatal error: Uncaught Error: Call to undefined function wp_get_current_user() in D:\inetpub\wwwroot\wordpress_OXUS\wp-includes\capabilities.php:878 Stack trace: #0 D:\inetpub\wwwroot\wordpress_OXUS\wp-content\plugins\groups\lib\access\class-groups-post-access.php(233): current_user_can() #1 D:\inetpub\wwwroot\wordpress_OXUS\wp-includes\class-wp-hook.php(324): Groups_Post_Access::posts_where() #2 D:\inetpub\wwwroot\wordpress_OXUS\wp-includes\plugin.php(256): WP_Hook->apply_filters() #3 D:\inetpub\wwwroot\wordpress_OXUS\wp-includes\class-wp-query.php(2717): apply_filters_ref_array() #4 D:\inetpub\wwwroot\wordpress_OXUS\wp-includes\class-wp-query.php(3824): WP_Query->get_posts() #5 D:\inetpub\wwwroot\wordpress_OXUS\wp-includes\post.php(2452): WP_Query->query() #6 D:\inetpub\wwwroot\wordpress_OXUS\wp-content\plugins\advanced-custom-fields\includes\class-acf-internal-post-type.php(401): get_posts() #7 D:\inetpub\wwwroot\wordpress_OXUS\wp-content\plugins\advanced-custom-fields\includes\class-acf-internal-post-type.php(359): ACF in D:\inetpub\wwwroot\wordpress_OXUS\wp-includes\capabilities.php on line 878
Given that this is a duplicate of this support thread, you can follow up there or reply here if the issue still persists.
Hi! I am having an annoying situation with Groups. When I changed the domain for my WP site, suddenly none of the pages protected by Groups work are working. Groups thinks that the user simply doesn’t have access to the page and shows Access Denied. WP is working fine with the new domain, no issues there. The permissions of the pages haven’t changed, the users are still the same, it’s just that Groups doesn’t seem to like the new domain. I tried removing and re-applying the groups to the pages, but to no avail. I guess Groups does care about the domain of the pages it’s protecting but does not know when the domain is updated.
Do you have any suggestions or workarounds?
Hi Nuno,
Could you please let us know what exact steps you undertook to move the site from one domain to another? Did you export and import the database? Did you move the site’s files from one server to another? Did you undertake any steps to export and import users?
What you describe sounds like something essential might be missing after you have moved the site. It might be a missing database table or data that has changed or is missing in the database. Please enable debugging and visit a few protected pages with a user that should have access, then do the same with a user who should not have access. Check the debug.log and let us know if there are any warnings or errors in it.
First, thank you so much for the prompt follow up! It’s awesome!
The matter has been resolved now.The steps were really just a domain name change at the DNS provider, while still using the same server and configuration. We also had a redirect to from the old domain to the new one.
The issue was that there were static links (leading to protected pages) on the home page that used absolute paths, including the old domain. Using those links resulted in going to the old domain URL, into pages that were protected by Groups. That’s when we got the Access Denied page. Once those links were updated to be relative or using the new domain name, Groups worked as expected.
The only feedback I would give is that I would expect the mismatched domain name to result in a message more like a 404 instead of an Access Denied message.
TLDR: nothing wrong with Groups, just remember to check any static links when doing a domain change. 🙂
Hi Nuno,
Thank you very much for taking the time to explain what happened in your case, that might be very helpful for others who find themselves in a similar situation. Much appreciated! And of course, great to hear that it’s resolved now.
Regarding your suggestion, as the domain mismatch would happen on the server level, it wouldn’t be possible for the plugin to detect that, but you can use this free tool to change the behavior and status code used: Groups 404 Redirect.
Cheers!
Hello, I work with WordPress version 6.2.2. I downloaded the groups plugin. Works fine. The shortcut [groups_join group="X"] works just fine. But can’t use the rest of the shortcut I will appreciate your help
Hi,
You can find the documentation on the shortcodes that Groups currently provides in the Shortcodes section of the documentation. I would recommend to review the documentation there and make sure that you use appropriate shortcode parameters.
Cheers!
Hello,
Send telegram link for chat?
Is it possible to Persianize the plugin?Hi,
You can submit translations via https://translate.wordpress.org/projects/wp-plugins/groups/ or add your translation via a fork and pull request on our GitHub repository. In the latter case, you would add the translation files based on the current translation template in the languages directory of the plugin. For example, you can see the currently supported translations here: https://github.com/itthinx/groups/tree/master/languages
Cheers
Hello,
We’re testing the Groups plugin and need some information on the add-on ‘Groups Restrict Comments Pro’
Is there a reason why the extension isn’t available at this moment?
Is there a possibility to get this extension?Thx in advance to give us a quick response,
Greetings,
JeroenHi Jeroen,
Thanks for asking! We have the extension on hold pending review and customer interest. Unless you have found another solution by now, please let me know and I’ll see if we can put out an updated version shortly.
Cheers
The Group Plugin has created to be many more groups for discussion with each other. There are so many functions in the groups.
Yeah we keep it simple but powerful, so there is quite a lot you can do. So do you mean it’s working for you?
Hi
My site has many password-protected posts,I found if use the group function to restrict password-protected post,the post can’t display on post list block,only public post can be displayedMay I ask ,how can I achieve “password potected ” and “group restricted” both happen in the one post
thank you
Hi James,
I’ve tried this out with a post that I protected with a password and restricted access to it using a group. When a member of the group visits the post, the member still needs to input the password, this is expected and correct. If a plain visitor visits the post, he will get a 404, which is also correct because Groups protects access to the post even before they get a chance to input the password.
So I guess the answer to your question is, you can simply apply both access methods together 🙂
Cheers
Hello!
I would like to create a group meta box to use with the ACF FrontEnd plugin in which posts are made on the frontend. It would be possible?
Hi Felipe,
Yes that’s possible, I would recommend you to have a look at how it’s done with the WordPress meta boxes when you edit posts: https://github.com/itthinx/groups/blob/master/lib/access/class-groups-access-meta-boxes.php
You can base your custom implementation for that case off it.
Cheers
Olá!
Gostaria de criar uma meta box de grupos para utilizar com o plugin ACF FrontEnd na qual as postagens são feitas no frontend. Seria possível?
Hi
After restricting a page wordpress shows a message. Is there a way to customize or localize traffic message?
Hi Arvind,
I’m not quite sure which message you refer to, maybe Groups 404 Redirect would be suitable for what you want to achieve?
Cheers
Hi,
I like the plugin but I have a couple of observations
– the groups_join shortcode doesn’t force a page refresh which means that it still displays data from any groups_non_member blocks. I had to add a button so the user can manually refresh: Refresh Page
It would be nice if this was an option to the groups_join shortcode.
– You do not seem to be able to nest groups_member/groups_non_member statements. The use case is rendering specific content
[groups_member groups="group1"]
Group 2 only
[groups_member groups="group2"]Show me only to group2[/groups_member][/groups_member]
The example was a table inside “group1” with a specific td containing a conditional for group2. The first /groups_member closes out the entire nest which causes everything that follows to break.
Hi,
Thanks for the suggestion! Sometimes it depends on how things are supposed to be displayed, as the join takes effect after submitting. One solution you could adopt is to have the join shortcode on a separate page than what the new member is allowed to see.
Regarding the nested shortcodes, you can nest them, as you can also nest the blocks that Groups provides. For your particular example however, the outer shortcode limits viewing the content to members of group1 – and then you further limit the content of the shortcode inside to members of group2. So to view everything, a member would have to belong to both groups. Maybe for your case, it’s better to separate this into two different sections on the same page, or split it up into different pages.
Cheers
Hello, I want to remove the default register group. I don’t like it Register group is added automatically when I create any other new group. I try to delete it but it is not possible. Please help!
Hi Neetu,
The Registered group is maintained automatically and cannot be deleted. This is by design, see also Memberships. If you don’t need it, simply don’t use it to restrict access and use groups that you create for that purpose instead – see the Groups section on how to add and edit new groups.
Cheers
Hello! I had messaged on WordPress.org forums about this issue, trying to get some help. We’ve been using this plugin to restrict page access for a few years now. Recently, some users are not able to access a certain page. The page content disappears even if I remove any group restrictions as a test.
The page is: https://realestatecentre.biz/broker-exam-prep-audio-downloads
I can provide admin access or anything else needed privately.
Thank you!
Hi Ross, thanks for following up here – we’ve created this topic where you can provide more info and access if needed later on.
Ok should I add more info and login credentials there? It says I need to log in for that thread (I do not have a login and I don’t see any way to register.)
Yes, if needed. We’ve added access here so you can post on the topic, you should have received the credentials in your email (make sure to also check your junk/spam folder in case it ended up there). You don’t need to send any credentials yet, please look out for replies on the topic with indications on steps that can help to figure out what is happening on your site.
Is there a way I can get faster help with this? Again I can pay for support if needed but this has been an issue for a few weeks now. There are no errors in debug, and no indication of invalid postmeta when I tried the suggested sql query to test that. I’ve been replying in the WordPress forum here:
https://wordpress.org/support/topic/groups-breaks-page-access/#post-16570390
but hoping to get some help to actually get this fixed more quickly. Thank you! please let me know
Hi Ross,
I’ve posted a possible simple solution on the topic https://wordpress.org/support/topic/groups-breaks-page-access/#post-16578413
Please give it a try.
Cheers
Hey!
I need to create a user, but that new user group should be automatically assigned the same user group as the person who created them.
So say the user is Group A – the new user created currently defaults to another group. I need it to go to Group A (or whatever group the creator is in).
Is is possible for a user to manage other users, only if they are in the same group?
Thank you
Hi Lee,
Thanks for asking, based on what you explain, I think this requirement also falls into the category discussed in Users managing WordPress Groups.
Regarding the requirement to have the new user assigned to them same group(s), currently you would be able to craft a solution using Groups’ API, an OOTB solution isn’t readily available for what you want to achieve.
As far as managing other users in general, the article goes into more detail on that topic. If you’d like to share more of your thoughts and requirement on this, please feel free to post there.
Cheers!
Hi Kento,
I’m experiencing a technical issue with the Groups plugin. We are seeing some of our WooCommerce Products are being hidden to guest users even though they don’t have any visibility restrictions in place.
When a user is not logged in and goes to a category page, they are missing some of the products that should be listed.
It appears that $product->is_visible() is returning false for the impacted products, but only when the Groups plugin is enabled.
If we deactivate the Groups plugin, the products resume showing as expected.
Can you let me know what we can try to address this? I’ve reviewed each of the group capabilities and I’m not seeing anything that should prevent them from accessing anything.
Hi there,
Are you using the legacy model based on capabilities to restrict access or are you using groups? What you describe could be related to remnant restrictions from capabilities that ceased to be used to restrict access, thus the question.
If you are using the legacy capability-based model : run this database query
select meta_key, meta_value from wp_postmeta where meta_key = 'groups-groups_read_post';
and check if there are any results corresponding to capabilities that do not exist or are not enabled for access restriction.If you are using group-based access restrictions, run this database query
select pm.meta_value, g.name from wp_postmeta pm join wp_groups_group g on pm.meta_value = g.group_id where pm.meta_key = 'groups-read';
and check if there are any entries that show NULL for the name column.The queries assume the default wp_ prefix, if your site’s database uses a different tablename prefix, make sure to adjust those.
Let’s see if there’s anything inconsistent in your database that should be removed based on the above.
Hello,
There were no entries for the first query, so we must not be using the legacy version.
For the second query, no results were found with null as the name.
These products in question do not have any Group access restrictions set on them either, these are set to be viewable by anyone.
Example of settings:
https://imgur.com/cTV2e7mSo if the user is logged in as an admin, they can see the products on the category page. If the user is not logged in, the product is for whatever reason, not visible.
Thanks for checking that, also the screenshot is useful as that shows you’re using the group-based restrictions (which is good).
Are you using the latest versions of Groups? It’s currently at 2.17.0 and there was a fix for potential errors in that release related to inconsistent postmeta values (that could be produced for a variety of reasons). If you’re not using that latest version, please make sure to update.
If you are using the latest version and see these issues, then I’d suggest to enable debugging and check the site’s debug.log when you try to access one of those products with a plain visitor (not logged in). Also check the server’s log for potential resource issues (memory exhausted, errors, …).
Hi,
I have error logging enabled but there is no errors present.
On the archive.php the $product->is_visible() function is returning false.
I have checked the documentation from WooCommerce and its not failing any of the checks from Woo, meaning:
Product is set to visible in catalog and search results
Product is set to publish status
Product is not out of stock, nor is WooCommerce setting enabled for “Hide out of stock products”.The $product->is_visible() function returns true as soon as I disable the Groups plugin.
Do you know of anything in your code that would be modifying the result? Again, the products impacted do not have any Group restrictions, they are set to visible to anyone.
So something within your plugin is certainly what caused the issue.
Disabling this filter that was added fixed our visibility issue with products:
https://imgur.com/7ccrkLLThis could be related to a cache conflict. Keep in mind that with the woocommerce_product_is_visible filter disabled, some product info from protected products could be revealed where the filter is relevant. So, although disabling it will prevent the products where the issue comes up from being hidden, it is not an appropriate solution overall.
Could you please let me know what caching system you are using on the site? Also, please give this a try: uncomment the filter, clear all caches and try to access one of the category pages where products were not shown.
Anyhow, I’m taking note to investigate this further to see if we can avoid such issues with caching in the related code.
Hi Kento,
Still trying to track down this bug. Even with the filter commented out we’re still seeing issues with products being hidden from search/category pages.
Here are the steps I’ve taken:
1. Go to /lib/extra/class-groups-extra.php, add a comment to line 35 to disable the visiblity filter.
2. Go to the product settings and verify that no restrictions are set on the product (bear in mind, these are products that never had a restriction on them in the first place).
3. Clear WP Engine Cache, Clear Sucuri Firewall cache.
4. Log out of the WP Admin backend
5. Go to category page, or search for one of the affected SKUs
6. WooCommerce returns “No results found”, or doesn’t display the product on the category page.
7. Disable the Groups plugin entirely
8. Attempt step 5 again, this time it returns the expected results.This is beyond frustrating at this point, we’re getting numerous complaints and losing sales due to customers not being able to find products on our website. We unfortunately cannot just quit using your plugin, as we do have Pages and other items that do have content restriction settings, but I really need you guys to give us some support here.
This isn’t a caching issue. These products have not and will not ever have any kind of Groups visibility restriction on them. So I’m not sure why cache is being blamed, as these pages wouldn’t have any cached versions of them where the content was hidden. Users logged in as admins can see the products, while guest users cannot, even though there is no setting that should be causing that.
Here is screenshots of the settings of the product, as well as the post meta values for anything I think could be related to your plugin.
Is there some kind of field in the database that could be causing this?
We have a sandbox environment that I will gladly give you access to, which you can use to recreate the issue and fix it.
Moved to this topic to investigate further: https://www.itthinx.com/topic/some-of-our-woocommerce-products-are-being-hidden-to-guest-users/
Thanks for checking this, that is very helpful. I’ll check your other comment and follow up there.
Hello there!
I am trying to code a plugin that makes it so that when a visitor is logged out, all products on a WooCommerce website is visible. But when logged in, should only see the products that are assigned to that user.
I have successfully made it possible to visit a product with a group assigned as a logged out user, using this filter: groups_post_access_user_can_read_post
But when looking at the product feed on the website, for example browsing a certain category, it is still not possible to see the products with groups assigned to them.
So my guess is that an additional filter is required. The filters inside the function “posts_where” seems like good candidates, but I am not sure how to use them correctly for this purpose. Could you please give some guidance on this issue?
I am also looking to have it so that a user that is logged in, should not be able to see products which has no group assigned to them, without having to add a generic group to them. Perhaps this is possible by using some filter?
Any help is very much appreciated!
Best Regards
//Erik – TemplHi Erik,
You could use the woocommerce_product_is_visible filter to determine the visibility of a product based on the group membership and the woocommerce_is_purchasable to determine whether one can buy it. The repositories groups-wc-not-purchasable and groups-wc-purchasable can serve as a reference for implementation of these filters.
With those you should be able to achieve what you describe, let me know how it works out!
Cheers
We’ve been testing out Groups and Groups File Access for a while now, with some success. Recently, we updated our website and php settings, and now, while Groups still works, Groups File Access no longer is showing embedded video or allowing users to download our uploaded files. It worked previously.
When we try to export, we get a blank text file, and when we re-upload our files, the entries are called invalid. The same happens when we’ve tried to upload new files.
The filepaths have not changed, and the files are not corrupted. Any insight into this would be greatly appreciated!
Hi,
This sounds like an issue which might be related to insufficient memory or conflicts with your overall setup and plugins involved. Please post a support request in https://www.itthinx.com/forum/groups-file-access/ so that our team can help you further. I would have created the request for you myself, but I can’t find your customer account.
Cheers
How can we create new groups through our own php code ?
Thanks for replying. Actually I am new to PHP, I have checked the examples present in the documentation already. I could not find a way to create a new group through code. The example shows how to assign a user to a group. But it does not mention, how to create new user groups. Thanks in advance for all the help.
Oh ok, thanks for clarifying 🙂
I’d suggest you have a look at this little plugin Groups Role Registration and particularly the line I’m linking to (line 59) where a new group is created based on a role. I’m pointing you to this example as it also shows you a few other bits which you might find useful while you learn to work with it.
There are further examples among the repositories https://github.com/itthinx?tab=repositories which are related to Groups.
Cheers!
Thanks so much for the help 🙂
I have a few further questions.
1. what is this for Groups_User_Group for?
2. How would you set parent of a group through code?You’re welcome!
The code is well documented and provides useful information on each class. If you use a good development environment like Eclipse, you will have a lot of information available on the spot while editing. Our Groups repository is also a good reference to look into.
#1 See https://github.com/itthinx/groups/blob/master/lib/core/class-groups-user-group.php
#2 See https://github.com/itthinx/groups/blob/master/lib/core/class-groups-group.php#L255Cheers!
Hi, is there any possibility i can sort on groups within the woocommerce orders tab? i.e. can i see all the completed orders in the group “members”?
Thanks in advance.
Hi Quint,
That’s an interesting idea, maybe we can take that into account for a future enhancement. I think it would be useful to be able to filter the orders by group memberships.
Note taken to look into it!
Cheers
Hello I installed the plugin, but it only works on the Desktop version. How can I add it to the mobile version?
Hi Ben,
If you are using an App on mobile, you won’t find it integrated automatically. In that case, rather use your mobile browser to access the Groups section.
Cheers
Hi, is there any way to redirect a user to a certain page after login . I used “groups login redirect” so far but it isn’t working anymore. I saw there is a redirect shortcode but I don’t know how to use it. If it is possible, could you please give an example?
Thanks in advance!
Hi Wilhelm,
The login shortcode allows to indicate the redirect attribute where you can provide the URL that you want it to redirect to after login. This is documented here.
Cheers!
Hi,
I work for a non profit, and we have a number of different groups within it – food, transportation, children services, community services, community development, etc. etc.
Our website is WordPress of course and I am looking to create groups within it so individuals in those groups can access and edit their pages/post, but only theirs. The Groups plugin seems like it will wok find for that.
However this is a publicly viewable website and we want people in the community to be able to access all of it. From what I read in the description if I assign page/posts to one group they are inaccessible to others. Does that include website visitors? I don’t me for them to edit or add, just to view and read…
Hi Lou,
It would be great if we could use Groups that way, but you wouldn’t be able to restrict editing to a certain set of posts by group membership with it. I know of similar suggestions and we’re working on enhancing Groups so it can be used also for these cases, but I can’t give you an exact timeframe for when this would be available. Regarding the visibility to public visitors, the posts that are protected with Groups would not be visible unless the viewer is logged in and has the appropriate group membership.
I wonder if the standard WordPress role Author would be suitable for your case? Authors can publish their own posts, but they can’t edit posts of others.
Cheers
Hi. Can any programmer give me some idea? maybe the “groups” plugin could be a solution.
Scenario. Multivendor site with wfcm ultimate and wcfm group and staff + woodmart theme + woocommerce.
in this site there are two groups.
1 group we will call “local”.
1 group we will call “ecommerce”.the “local group” should have only the catalog mode available by default. no shopping cart. only the prices.
the “ecommerce”. group should not have the catalog mode available. This seems easy by disabling the catalog mode of Group and staff in the options it has.
the problem is the “local” group
They should be able to select the group that corresponds to them (local).
then select one of the memberships for that group.
then they should be able to upload their products in catalog mode “without having to uncheck options every time they upload a product”.
This is the real problem. when I tested with sellers, most of them forgot to check the catalog mode and then forgot to check the “remove from cart” option.I can’t believe it’s so difficult. of course I tried already with the wcfm people, but without success.
thank you.
Hi Pablo,
Although I’m not familiar with the particular plugin you are using to manage things, based on what you explain I think these additions based on the Groups plugin might be helpful for your case:
* groups-wc-purchasable
* groups-wc-not-purchasableAnyhow, these would just be useful to provide guidance in your case, it’s very likely that you would have to create a customized solution. You might be able to take a similar approach to a “catalog mode” based on group-memberships. Your local group would seemingly also need to have prepopulated or fixed options set, which again could be determined based on the user’s group-membership.
Also this post might be helpful for you: How to Use WooCommerce as a Catalog.
Cheers
There is a new tutorial How to use WordPress to provide Confidential Documents which uses Groups and Groups File Access to provide protected downloads.
Hello, thank you for your reply. I also think that a custom modification would be needed. Both the theme and the multi vendor plugins are compatible with ACF and toolset.
I do not know the operation of these two tools.I am reading the info in the links you sent me. Very interesting. I will try the solutions you detail there.
The other solution that occurred to me is to use the catalog mode that brings the theme. I mean that the catalog mode is enabled by default. I would only have to see how to set a group that “disable” the catalog mode. I don’t think it would be very difficult.
What I do not understand is how to make the registration process in each group automatically…
Seller—choose group (with cart or without cart)—then register in the chosen group——-then select membership plan—start uploading product.
ok. if i solve it i will tell you the solution. Thanks!
Hi Pablo,
Yes, if you check whether the current user belongs to the right group (or not) you could then enable or disable the features that are not needed when you only want to show the shop as a catalog.
If could be as simple as this:
$catalog_only = false;
require_once( ABSPATH . 'wp-includes/pluggable.php' );
if ( $group = Groups_Group::read_by_name( 'Catalog' ) ) {
$catalog_only = Groups_User_Group::read( get_current_user_id() , $group->group_id );
}
if ( $catalog_only ) {
add_filter( 'woocommerce_is_purchasable', '__return_false' );
}As to the question of how you could automatically assign the user account to the appropriate group, I would look for a solution that adds a selection field to the registration and then use the right action in the form plugin to add the user to the corresponding group. You will find an example of how to add the user to a group right at the top of this documentation page.
Cheers!
I have Groups setup on a site and it works really well! Thanks for the plugin! I am needing to create search functionality so that users can search for other users based on their group assignment (or user role, since I have the WordPress user roles tied to each group). Is there a plugin that works with Groups to accomplish something like this? I have been searching, but haven’t found one yet.
I am looking for functionality similar to this page: https://www.murraystate.edu/phone/ although I don’t need the department box on the right side and I don’t need the “reverse lookup” radio button functionality, just a simple text box to enter a first/last name and select a group/role to limit the search by.
Thanks for your help!
Hi Jacob,
Thanks for using Groups! I don’t know of a specific plugin you could use for this particular search, but given that your roles and groups seem to be mapped upon each other, you might just be able to use the get_users() WordPress core function. It accepts
role
andsearch
as part of the $args parameter which you could use to search users by role that match the keyword.If later on you need to work more specifically with groups, I’d also recommend to look at the Examples of the API section of the documentation. But at this point, you probably won’t need to use Groups’ API itself given the role-group mapping.
Cheers
Hey Kento!
Thanks for the response! This was the path I was thinking to go down if there wasn’t already something else in place. I will just build out a custom solution with get_users().
Thanks for pointing out the API for Groups. That could definitely come in handy down the road!
Thanks again!
Perfect, good luck with the implementation!
Hello, I am using the groups plugin on wordpress and would like to translate the login box. Where can I do this because I cannot find anything in the pot files? Thanks
Hi Wilhelm,
If you are using the [groups_login] shortcode, it uses wp_login_form() so you won’t find any translatable strings related to Groups, as these are translatable strings related to WordPress core.
Cheers
Hi guys,
I have a question, as far as I understand, if a product in WooCommerce does not have any group tied to it, it will be visible to all users. Is it somehow possible to make it so that users in a certain group only see products that are associated with that group and no other products, even those without any product associated with them?
Cheers
ErikHi Erik,
First you would have to protect all products with a generic group used for that purpose. Protect all products with that group, that would achieve the effect of hiding all products from anyone. Then, for those who should be allowed to see certain products, also add those products to their group.
So, for example, let’s call the generic group “Generic” … protect all products using that group. None of the users who should only see a limited set of products should belong to this group.
Assume a second group “Specific” and assign some products to it. Now you have a set of products which are related to the “Generic” and the “Specific” group.
Add a test user to the “Specific” group and log in as that user. The user will be able to see those products and none of the others.Cheers
Hello, I tried your group plugin and it is easy to use. I am using it for hiding some pages in navigation for nonregistered users. I’d like to know if it is possible, when a registered user login into page with his username and pass, that he is redirected to a member page not to dashboard or I must use some other plugin for redirecting users?
Thank you and best regards,
PiceroHi Picero,
The Groups 404 Redirect extension for Groups would be appropriate for this. It’s free and the documentation page for it is here, please give it a try.
Cheers
Thank you!
Hi, I am hoping to get some quick help on this. I have 2 groups: group1 and group2. All users in group2 are also in group1. There are however users in group1 that are not in group2. I want to have a WooCommerce product “X” be seen by group2, and product “y” be seen by users in group1 that are NOT in group2. I am hoping to keep it so that group2 does not see both. It is fairly easy to do this type of logic in Gutenberg blocks with the ability to nest the blocks combined with the member and non-member blocks. I don’t see how to do this in the Groups/Woocommerce integration. I am hoping to do this without having to create a group3 to include the subset (users in group1 that are NOT in group2). I hope this makes sense. Any thoughts would be helpful.
Thanks in advance.Hi Dean,
For this customized rule you would have to use filters on parts of the post access control system. A start would be to use the groups_post_access_user_can_read_post filter where you would check the group memberships using Groups’ API (see Examples on how to obtain a user’s membership for a particular group). You might also need to use the groups_post_access_posts_where filter to make sure that the exclusion is upheld when WordPress retrieves sets of products, e.g. when showing them in the shop.
As you can see, this requires a certain level of customization on your part, but if you know how to work with filters or use an experienced developer to do this for you, it’s quite easy actually.
Cheers
Greetings,
How do I preview the groups I’ve created? The system did not produce a link once I created a group in the WP dashboard.I’d like to see what the user interface looks like for group members — i.e., can they see the top or right navigation bars of my theme?
Thanks,
AntoinetteHi Antoinette,
It would be suitable to create one or more test user accounts that are assigned to the groups you would like to check out. You can work with your administrator account in one browser and work with a test user in another browser while you test things. The menus will usually contain items depending on whether the users have access to their content, e.g. if you create a Page menu item and that page is protected, only members of the corresponding group will see the item. This does not apply to custom links. I’d recommend to have a look at the documentation, for example the section on Access Control where you can find more info and ideas.
Cheers
Hi! I’m creating a post form on the frontend. How do I display a list of groups and select? The plugin I will use is ACF.
Hi Felipe,
I’m not aware of a particular integration with Groups for ACF. What you could do, is try to use Groups’ shortcodes or API maybe inside a customized template.
Cheers
Hello – Thank you for taking my question. Can members in groups upload photos or files or videos with Groups?
Hi Tamryn, thanks for asking! To let group members upload files you could use a protected section along with a form plugin. The uploaded files would however not be restricted to the group members. We do provide a premium extension Groups File Access but it allows to manage protected files via the back end where users with administrative rights can upload files and determine which group members can access them. But this extension would not allow group members without administrative rights to upload files.
Hello – can you please tell me if all of the Groups plugins are available for wordpress.com sites (not wordpress.org)? Thank you in advance 🙏♥
Thanks for asking!
To be able to install any plugin, you need to have at least the Business plan on WordPress.com – see https://wordpress.com/pricing/ – if that’s what you have in mind, you can install its extensions.
Cheers
Hello Kento,
Thank you for showing me where to find it. This is so helpful 🙂
Hello – can you tell me please if Groups is compatible with Thrive Themes?
Thank you 🙂
Hi Tamryn,
I guess so, simply try it out? It works with any theme as long as the theme doesn’t do weird stuff with post types.
Cheers
Thank you Kento for your answer 🙂
I would like to display a list of the users of groups that are assigned to posts with a short code, what would be the shortcode to do this? Some posts might have multiple groups assigned to the them so the list needs to include all of the users from the assigned groups.
ThanksHi Brandon,
There is an example shortcode implemented as a plugin in this repository https://github.com/itthinx/groups-list-users which you could take as a basis to extend and display the information that you would like to show. This other repository https://github.com/itthinx/groups-sandbox might also be helpful as it provides another example shortcode that works with posts and groups.
Cheers
Hello,
I want to see if when a customer changes groups or gets assigned a new group if the customer’s modified_date timestamp gets updated. If not, is this something that could get implemented with this plugin?
Thank you!
Hi Andrew,
A group membership would not necessarily modify the timestamp unless that happens because you are e.g. editing the user on the back end. If you want to assure that the timestamp is modified on every group membership event for a user, you could use these actions to hook into and modify the timestamp appropriately:
– groups_created_user_group
– groups_updated_user_group
– groups_deleted_user_groupThese actions are documented on https://docs.itthinx.com/document/groups/api/actions/
Cheers
Hi,
I’d like to request a feature / report an issue.
A user that’s in a group with permission to add posts can only see the groups they are in or that their group is parent of when adding a post, which is good; this is expected behaviour.
But when the same user scrolls through the list of posts (https://my-wp-url.org/wp-admin/edit.php), that their group has permission to see, there is unexpected behaviour: In the “groups” column, the user can also see groups (out of the hierarchy) that their group is not parent of, so groups they shouldn’t see, like when adding a post.Example:
Having users Jane and John and groups “cool”, “great”, “genius” and “special” with hierarchy genius > great > cool (where ‘>’ means parent of) and “special” which coexists apart from hierarchy and contains some special users that might be in some of the other groups.
Jane is in group “genius”, John is in groups “great” and “special”.When John adds a post, he can choose whether he wants to restrict the post to members of “great”/”special” or make it visible to the “cool” members, too. Which, again, is expected.
When John scrolls through all the posts he has access to, he finds a post, that was added by Jane and restricted to “special” members which John is a member of, so he can see the post, which is fine. But Jane also released this post to some other group, say “buddies” whose group name is now visible to John in this view. This is unexpected.Thanks for taking a look at this!
CheersHi kia,
Many thanks for describing this in detail! Yeah we should probably hide those group names from those who are not members. Note taken to include in an update.
Cheers
On second thought … it could also be considered useful and necessary that the group(s) that John in this case is not a member of are visible to him. Consider that for example Jane might need to grant access to the “buddies” group and would like John to be aware of it, even though he doesn’t belong to them. In fact, if John goes in and makes a change and saves the post, if he doesn’t belong to the group, those members won’t have access anymore. Example:
We have these groups: Health, Fruit and Vegetables.
John and Jane are both members of the Health group.
John is a member of Fruit.
Jane is a member of Vegetables.John creates a new Post and restricts it to the groups Health and Fruit.
Jane can see that the Post is restricted to those groups on the Dashboard under Posts.
Now Jane edits this same Post, but she will only be offered the Health or Vegetables groups for restriction. Even though the Post is still protected by both the Health and the Fruit groups, she will only see Health in the Groups > Read field. If Jane saves the post, she might think that she’s not changed anything, but she’s actually removed access to the post from the members of the Fruit group.Hey Kento,
Thank you for your reply. I thought a bit about it and I’m partly confused.
Shouldn’t it be that all changes that are made on a post are connected to that post and not to the groups?But I see that it makes sense that someone knows if they edit a post that these changes might be visible to other people too.
So maybe it makes sense to show an information that informs the user that the post is visible to other groups that this user isn’t part of.
So in your example, Jane would see her groups as described and an additional note that there are other groups that can see the post.
Cheers,
KiaHi Kia,
Many thanks for your thoughts on that.
> Shouldn’t it be that all changes that are made on a post are connected to that post and not to the groups?
I would say yes and no, depending on what perspective one would assume. I think that the confusion comes from the mix of a) users can edit posts depending on role and b) users can assign groups depending on their group membership.
Ideally, a user who creates and maintains a post would be able to lock/protect a post from editing by other users who do not belong to the “right” group(s). The problem IMO is that we still do not have fine-grained permissions that would allow to act on particular objects (i.e. posts in this case).
> So maybe it makes sense to show an information that informs the user that the post is visible to other groups that this user isn’t part of.
Yes, I think that it makes sense that everyone who can edit posts can see what groups are granting read/view access to a post, even though they do not belong to all groups that are related (but as long as they belong to at least one of them, otherwise they wouldn’t be able to see the post listed).
> So in your example, Jane would see her groups as described and an additional note that there are other groups that can see the post.
Maybe it would be a good idea to show that a group is “locked” when a user is editing a post with a group that the user does not belong to. But my gut tells me this would be going in a direction where we’re patching up things as a consequence of having incomplete administrative features (features which in fact we do currently lack).
I reckon that as long as we don’t have a fine-grained permission model underlying, these scenarios will always be ambiguous and confusing. The good news is that we’ve been looking into this and working on extending our data model to make that happen, but it still seems a long stretch until we can get to something that is pragmatic.
I’d love to hear feedback from anyone who’s following these ideas around Groups.
Cheers
Hi Kento,
Many thanks for your reply.
I see, there’s quite some things to consider for not producing unexpected behaviour …
Maybe a safe way that does not include major reconstruction would be to only extend the groups column (e.g., in the list of posts) with a note that other groups have access to a content without spoiling the groups’ names. This would be consistent with the selection of groups that a group member sees when producing their own content.However, I don’t want to bother you too much on this! If you think this makes sense, it’d be nice to have this feature included in a further release. If not, I’ll survive it 😉
Cheers!
Thank you very much for your ideas, it’s not a bother at all but really valuable feedback!
What you suggest also makes sense to me, maybe not for everyone, but I can see that in certain cases it would. We could consider that even via filters that allow to adjust what Groups is showing so one can easily customize those views.
The more I think about it, the more complex the scenarios get 😀 …
Hi, can a group have an admin user? I mean, an user that have more capabilities than a regular one, like add and delete users of their group.
Is it possible? Thanks!
Hi Isidro, good question and in line with what we are working on as an extended data model for Groups. At the moment, the permissions related to groups are rather coarse, meaning that you cannot determine a specific permission for someone towards a specific group.
Hi,
I need to set up a website with private areas with the following features:
– 3 levels of permissions: global admin, group manager, and group member
– members have private pages/areas, only accessed by each member and their group manager.
Private pages CANNOT be created via passwords, because it is not feasible for the manager to enter N passwords to access them all– each group has a shared 1st page/area, accessed by all members
– the manager of each group accesses the area of each group member (to edit, share files). cannot access other groups
– the site must easily allow the creation of 10s of groups, each group with 100s of users
– must support the upload and management of 1000s of files, up to 1GB of data. with reduced cost (up to €100/month)
ideally it will be self-hostedI needed to know if it this plugin do this.
Thanks,
JoseHi Jose,
Based on your requirements there is no ready-made solution that meets all the points based on Groups, but you could approach this based on Groups and develop customized functionality as needed. Groups File Access might be helpful to restrict access to those files, but whether it would be sufficient depends on how exactly you envision the file uploads and how far group managers would be involved and have permission. I would recommend to set up a couple of test pages based on Groups for two different groups, and see how close the basic thing gets to what you want. Then compare it to a couple of other solutions not based on Groups and see which one comes closest. For such cases it’s better to look at several alternatives, and make a better-informed decision. If you then conclude that Groups comes closest, I would recommend to test Groups File Access to handling the files. For a relatively affordable solution you could host the files on the server or use Amazon S3 to store and serve files, the extension integrates with Amazon S3 for that purpose, see How to protect Amazon S3 Files with WordPress for Members and the File Access section of the documentation for that extension. In any case, I would expect that you need to do a fair amount of custom development to get to the solution you want.
Cheers
Hi Kento,
Thanks for your message!
Best regards,
Jose
Leave a Reply