LearnDash Automations
Add a User to a LearnDash Group When a WooCommerce Product Is Purchased
When you sell a team plan or a course bundle, group membership — not a single course enrolment — is usually what should happen at checkout, since a group can unlock several courses at once. Zapify does this with the A product is purchased trigger (WooCommerce) and the Add a user to a group action (LearnDash). LearnDash is a Zapify PRO integration.
What this automation does
The automation is one trigger plus one action:
- Trigger: A product is purchased (
WC_PRODUCT_PURCHASED, WooCommerce) - Action: Add a user to a group (
LEARNDASH_ADD_TO_GROUP, LearnDash)
When the WooCommerce product you choose is purchased, Zapify adds the buyer to the LearnDash group you specify, which grants them access to every course attached to that group.
The action calls LearnDash's own ld_update_group_access() function, so it behaves exactly like adding someone to the group by hand.
Before you start
- WooCommerce and LearnDash must both be installed and active.
- Zapify PRO must be active, since LearnDash is a PRO integration.
- You need the product that should grant group access, and the group ID it should add buyers to. Find the ID in the group's edit URL in your WordPress admin —
post.php?post=456&action=editmeans the ID is456.
PRO feature
LearnDash (learndash) is a Zapify PRO integration. The Add a user to a group action requires an active PRO licence. The A product is purchased trigger itself is free (WooCommerce).
How to build the automation
Step 1: Create a new automation
- In the WordPress admin, go to Zapify → Automations.
- Click Add New to open the builder.
- Name it clearly, such as Add buyer to team plan group.

Step 2: Add the "A product is purchased" trigger
- Click Add Trigger.
- Choose WooCommerce as the app.
- Select the trigger A product is purchased.
- In the trigger's Product field, select the specific product — for example your team-plan or bundle product.



Step 3: Add the "Add a user to a group" action
- Click Add Action.
- Choose LearnDash as the app.
- Select Add a user to a group.



Step 4: Configure the action
| Field | Required | What it does |
|---|---|---|
| Group | Yes | The group ID to add the buyer to. Usually typed directly, since it isn't the token from this trigger. |
| User | No | Leave empty to use the person the automation is running for — the buyer. |
| Remove from the group instead | No | Off (default) adds them. Turn it on to build the reverse automation on a refund or cancellation trigger. |

Step 5: Set the steps Live and save
- Set both the trigger and the action to Live.
- Click Save.

Tokens this action makes available
| Token | What it holds |
|---|---|
| Group ID | The group the buyer was added to. |
| User ID | The ID of the user who was added. |
How to test it
- Place a test order for the selected WooCommerce product and mark it as paid.
- Check the buyer's group membership from LearnDash's group admin screen, or confirm they can access one of the group's courses.
- If they weren't added, open Zapify → Logs — a re-run on someone already in the group reports no change, which is expected rather than a failure.
Conclusion
With the A product is purchased trigger and the Add a user to a group action, Zapify turns a single WooCommerce sale into access for every course a group unlocks — no manual group management. Next, greet the group's courses with an email when a user is enrolled on a LearnDash course, or grant a matching WordPress role at the same time with add a role to a user when they join a LearnDash group.
FAQs
What's the difference between this and enrolling on a course directly?
Enrolling puts a buyer on one course. Adding them to a group gives them everything the group unlocks, which can be several courses — this is the action to use for team plans and bundles.
Is this feature free?
The A product is purchased trigger is free. The Add a user to a group action is part of the LearnDash PRO integration, so it needs an active PRO licence.
What happens if I add someone who's already in the group?
LearnDash treats it as a no-op — the action checks membership afterwards and logs where the user actually ended up, rather than reporting a false failure.
Do I need to know the exact group ID?
Yes. Open the group in your WordPress admin and copy the ID from the edit URL.
Do I need to write any code?
No. Everything is configured in the Zapify visual builder.