LearnDash Automations
Add a User Role When Someone Joins a LearnDash Group
Groups are how LearnDash gives a cohort — a class, a company, a cohort of buyers — access to a set of courses at once. If your site also gates other content by WordPress role, a student joining a group should pick up that role automatically. Zapify does this with the A user is added to a group trigger and the Add a role to a user action.
What this automation does
The automation is one trigger plus one action:
- Trigger: A user is added to a group (
LEARNDASH_GROUP_JOINED, LearnDash) - Action: Add a role to a user (
WP_ADD_USER_ROLE, WordPress)
When a student is added to the group you choose, Zapify grants them the role you specify.
Zapify listens on LearnDash's ld_added_group_access signal, which fires only when membership actually changes — adding someone already in the group does not fire it again.
Before you start
- LearnDash must be installed and active.
- Zapify PRO must be active, since LearnDash is a PRO integration.
- The group and the role must already exist.
PRO feature
LearnDash (learndash) is a Zapify PRO integration. The trigger requires an active PRO licence. The Add a role to a user action itself is free (WordPress).
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 Grant cohort role on group join.

Step 2: Add the "A user is added to a group" trigger
- Click Add Trigger.

- Choose LearnDash as the app.

- Select the trigger A user is added to a group.

- In the trigger's Group field, pick the specific group, or leave it on Any group.
Step 3: Add the "Add a role to a user" action
- Click Add Action.

- Choose WordPress as the app.

- Select Add a role to a user.

Step 4: Configure the action
| Field | Required | What it does |
|---|---|---|
| Role | Yes | The role to grant — pick from your site's registered roles. |
| Replace existing roles | No | Off (default) keeps the roles the user already has; on replaces them with just this one. |
| User | No | Leave empty to use the person the automation is running for — the student who joined. |

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

Tokens you can use
| Token | What it holds |
|---|---|
| Group ID / Group title / Group URL | The group the student joined. |
| Joined at | The date and time they were added. |
How to test it
- Add a test student to the selected group, either directly in LearnDash or through a purchase that grants group access.
- Check the student's account in Users to confirm the role was added.
- If the role wasn't added, open Zapify → Logs to see whether the run fired.
Conclusion
With the A user is added to a group trigger and the Add a role to a user action, Zapify keeps WordPress roles in sync with LearnDash group membership without manual admin work. Next, put a whole cohort into a group automatically after a bundle purchase with add a user to a LearnDash group when a product is purchased, or take the role back when access is removed with remove a role when a user is unenrolled from a course.
FAQs
Does this fire if the student was already in the group?
No. LearnDash only fires ld_added_group_access when membership actually changes, so re-adding someone who's already in the group won't trigger the automation again.
Is this feature free?
The Add a role to a user action is free. The trigger is part of the LearnDash PRO integration, so it needs an active PRO licence.
Can one group grant more than one role?
Yes. Add a second Add a role to a user action with a different role.
Do I need to write any code?
No. Everything is configured in the Zapify visual builder.