If you use (or have used) the Groups plugin for WordPress to manage user groups and capabilities, you can import user’s groups as user Memberships.
When groups are imported, you can map the user groups to a membership plan. For example, any member in the “Silver” group can be given access to the “Silver membership” plan. If a user already has access to this membership, the user will be skipped in the import rather than creating another plan for the user.
Note that this will not create a “sync” with Groups, but functions more as a one-time import from Groups to Memberships (though the import can be run as many times as you’d like if you need to import more users into Memberships in the future).
Importing members from Groups
When the Groups plugin is activated while Memberships is active, a new setting is added to start the members import from Groups under WooCommerce > Settings > Memberships > General:
When this button is clicked, it will begin the import process. For each group, you’ll be asked to either skip adding the users from this group to a membership plan, or determine which plan the users in the group should have access to.
For example, if I have a “Silver” group that has 150 users, and I map this group to the “Silver Membership” plan, each of those 150 users will have a silver membership plan created and activated. If the user already has a silver membership plan, a new one will not be created.
Once you’ve mapped all groups to the appropriate membership plans, you can click “Confirm Import”, which will complete the import and assign memberships to users that have the appropriate groups.
Important notes
Here are a few behaviors of which you should be aware while using this import wizard.
- When users are imported, the membership plan’s settings will be respected in terms of content access and expiration. For example, if a membership is valid for one year, and the member is imported from Groups, then the membership will expire one year after the import date.
- If a user is in multiple groups, and each group is mapped to a membership, the user will also have multiple memberships. Example: a user is in the “silver” and “gold” groups, which are mapped to silver and gold memberships respectively. Following import, this user will have both a silver and a gold membership assigned to the user account.
- Membership plans will be skipped if the user already has access to a plan. Example: a user is in the “silver” group, and the import maps this to the “silver membership” plan. If the user already has access to a silver membership plan, this user will be skipped and a new silver membership plan will not be created.
- Large imports: If your site is importing a large number of members from Groups (i.e., over 2000 users), you may experience a timeout (depending on your hosting environment). This is expected behavior, as the import is not done via ajax. The first couple thousand or so members will be imported, and the import may time out. You can simply re-run the import process to complete the import, as any members that have already been imported will be skipped. This process can be repeated until all members are imported.
It’s highly unlikely that you have enough members to timeout while the plugin checks and skips members (thus preventing a full import), but if you try to repeatedly import members and cannot do so due to timeout issues, please get in touch so we can advise you on next troubleshooting steps.