WooCommerce Automations
Remove LifterLMS Course Access When a WooCommerce Order Is Refunded
If you grant LifterLMS course access through a WooCommerce purchase, you want that access removed automatically if the order is later refunded or cancelled — not tracked by hand. Zapify does this with the An order's status changes trigger (WooCommerce) and the Remove a user from a course action (LifterLMS). LifterLMS is a Zapify PRO integration.
What this automation does
The automation is one trigger plus one action:
- Trigger: An order's status changes (
WC_ORDER_STATUS_CHANGED, WooCommerce) - Action: Remove a user from a course (
LIFTERLMS_UNENROL_USER, LifterLMS)
When the order changes to the status you choose — for example Refunded — Zapify removes the customer's enrolment from the course or membership you specify.
The action calls LifterLMS' own llms_unenroll_student() function, so the student's enrolment history is kept; they simply lose access rather than having their record deleted.
Before you start
- WooCommerce and LifterLMS must both be installed and active.
- Zapify PRO must be active, since removing a LifterLMS enrolment is a PRO action.
- You need the course's post ID (see Enrol a user on a LifterLMS course when a WooCommerce product is purchased for how to find it).
- This automation is the natural pair to that enrolment automation — set up both if you grant access through WooCommerce.
PRO feature
The Remove a user from a course action (LIFTERLMS_UNENROL_USER) is part of the LifterLMS PRO integration. The An order's status changes 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 Remove course access on refund.

Step 2: Add the "An order's status changes" trigger
- Click Add Trigger.
- Choose WooCommerce as the app.
- Select the trigger An order's status changes.
- Set the status this automation should watch for, for example Refunded.



Step 3: Add the "Remove a user from a course" action
- Click Add Action.
- Choose LifterLMS as the app.
- Select Remove a user from a course.



Step 4: Configure the action
| Field | Required | What it does |
|---|---|---|
| Course or membership ID | Yes | The post ID of the course (or membership) to remove access from. |
| User | No | Leave empty to use the customer the order belongs to. |

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 |
|---|---|
| Course ID | The course or membership ID access was removed from. |
| User ID | The ID of the user who was removed. |
How to test it
- Place a test order for the product linked to the course, and enrol the test customer (see the companion enrolment guide above).
- Change that order's status to Refunded in WooCommerce.
- Confirm the customer's LifterLMS enrolment has been removed.
- If access wasn't removed, open Zapify → Logs for the run's reported reason.
Conclusion
With the An order's status changes trigger and the Remove a user from a course action, Zapify keeps LifterLMS enrolments in sync with WooCommerce refunds automatically. Pair it with enrol a user on a course when a WooCommerce product is purchased so access is granted and revoked without manual work either way.
FAQs
Does this delete the student's progress?
No. LifterLMS keeps a record of the enrolment history; the student is simply unenrolled and loses access, rather than having their data deleted.
Is this feature free?
The An order's status changes trigger is free. The Remove a user from a course action is part of the LifterLMS PRO integration, so it needs an active PRO licence.
Can I watch for more than one status, like both Refunded and Cancelled?
Add a second trigger to the same automation, or a second automation, for the other status — the trigger watches a single status at a time.
What if the customer bought more than one course-linked product in the same order?
Add one Remove a user from a course action per course, each with its own course ID.
Do I need to write any code?
No. Everything is configured in the Zapify visual builder.