Skip to content

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

  1. In the WordPress admin, go to Zapify → Automations.
  2. Click Add New to open the builder.
  3. Name it clearly, such as Grant cohort role on group join.

Create a new automation

Step 2: Add the "A user is added to a group" trigger

  1. Click Add Trigger.

Add a trigger

  1. Choose LearnDash as the app.

Select LearnDash as the trigger

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

Select A user is added to a group

  1. 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

  1. Click Add Action.

Add an action

  1. Choose WordPress as the app.

Select WordPress as the action

  1. Select Add a role to a user.

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.

Choose the role to add

Step 5: Set the steps Live and save

  1. Set both the trigger and the action to Live.
  2. Click Save.

Set the automation live

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

  1. Add a test student to the selected group, either directly in LearnDash or through a purchase that grants group access.
  2. Check the student's account in Users to confirm the role was added.
  3. 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.

Was this page helpful?