How to Manually Enroll and Unenroll Students in LifterLMS
Where to manually enroll a student in a LifterLMS course or membership, what Cancel, Reactivate and Delete Enrollment each do, how order-based…
Read articleA client sends a spreadsheet with 400 names and asks for everyone to be in the course by Monday. LifterLMS can bulk enroll students, but it has no "upload a CSV of enrollments" screen. You need two steps: get the people into WordPress as users, then enroll those users in the right course or membership.
This guide is for site owners and the developers who support them. It covers the bulk tools built into the free plugin, a no-code CSV route using a user import plugin, and a reusable WP-CLI script that creates accounts and enrolls them in one pass. It ends with how to check the result and roll it back if something goes wrong.
For enrolling one or two people, or for understanding the Cancel and Delete buttons, start with our guide to manually enrolling students.
LifterLMS's own student bulk enrollment documentation describes the Users screen method. Together with the other core tools, you have four options before you need a CSV at all:
| Tool | Where | Best for |
|---|---|---|
| Users screen bulk enroll | Users > All Users | Enrolling existing users you can select in a list |
| Enroll New Students | Student Management box on a course or membership | A handful of named people |
| Enroll All Members | A membership's auto-enrollment list | Adding a new course to everyone already in a membership, in the background |
| Vouchers | Orders > Vouchers | People who do not have accounts yet and will register themselves |
Vouchers deserve a mention because they avoid the import altogether. You generate codes, send one per person, and each student registers and redeems it on the dashboard. That shifts account creation to the learner and keeps their chosen password private. Our coupons and vouchers guide covers the setup. The paid LifterLMS Groups add-on is another route for company seats; it lets a group leader paste a list of email addresses to send invitations in one go.
When you have a spreadsheet and the people need accounts created for them, use one of the CSV workflows below.
Most failed imports are spreadsheet problems. Clean the file first.
email, first_name and last_name. Add a course_id column if different people go into different courses or memberships.This is the no-code route and works well up to a few hundred people.
Use a user import plugin such as Import and export users and customers from WordPress.org, which creates users from a CSV, updates existing ones instead of duplicating them, and can send account emails. If you have SSH access, WordPress's own wp user import-csv command does the same with a CSV of user_login, user_email, display_name and role. Its --skip-update option leaves existing users alone, and --send-email sends new users their details.
Set the role to student, the role LifterLMS creates for learners, so the new accounts do not get dashboard access they do not need.
The selector only appears for users with the manage_lifterlms capability, so administrators and LMS Managers can use it but instructors cannot. Each enrollment is recorded with your admin account as the trigger.
For larger lists, mixed courses, or an import you will repeat every term, a script is faster and leaves a clear record. The one below reads a CSV with email, first_name, last_name and course_id columns, creates missing users with the Student role, and enrolls each person using LifterLMS's own llms_enroll_student() function. It defaults to a dry run.
<?php
/**
* Bulk enroll from CSV.
* Dry run: wp eval-file llmsx-csv-enroll.php students.csv
* Real run: wp eval-file llmsx-csv-enroll.php students.csv go
*/
$file = isset( $args[0] ) ? $args[0] : '';
$dry_run = ! ( isset( $args[1] ) && 'go' === $args[1] );
$trigger = 'llmsx_csv_' . gmdate( 'Ymd' );
if ( ! $file || ! is_readable( $file ) ) {
WP_CLI::error( 'Pass a readable CSV file.' );
}
$handle = fopen( $file, 'r' );
$header = array_map( 'trim', fgetcsv( $handle ) );
while ( ( $row = fgetcsv( $handle ) ) !== false ) {
if ( count( $row ) !== count( $header ) ) {
continue;
}
$data = array_combine( $header, array_map( 'trim', $row ) );
$email = sanitize_email( $data['email'] );
$course = absint( $data['course_id'] );
if ( ! is_email( $email ) || ! in_array( get_post_type( $course ), array( 'course', 'llms_membership' ), true ) ) {
WP_CLI::warning( "Skipped row: {$data['email']} / {$data['course_id']}" );
continue;
}
$user = get_user_by( 'email', $email );
if ( $dry_run ) {
WP_CLI::log( ( $user ? 'Existing' : 'New' ) . " user {$email} -> {$course}" );
continue;
}
if ( ! $user ) {
$user_id = wp_insert_user(
array(
'user_login' => $email,
'user_email' => $email,
'user_pass' => wp_generate_password( 24 ),
'first_name' => sanitize_text_field( $data['first_name'] ),
'last_name' => sanitize_text_field( $data['last_name'] ),
'role' => 'student',
)
);
if ( is_wp_error( $user_id ) ) {
WP_CLI::warning( "{$email}: " . $user_id->get_error_message() );
continue;
}
} else {
$user_id = $user->ID;
}
$done = llms_enroll_student( $user_id, $course, $trigger );
WP_CLI::log( ( $done ? 'Enrolled ' : 'Already enrolled or failed ' ) . "{$email} in {$course}" );
}
fclose( $handle );
WP_CLI::success( $dry_run ? 'Dry run finished.' : "Done. Trigger used: {$trigger}" );
Three details make this script safe to rerun. llms_enroll_student() returns false for people who are already enrolled instead of duplicating them. Existing accounts are matched by email and left as they are. And every enrollment gets a dated custom trigger such as llmsx_csv_20261030, which shows up in the Enrollment Trigger column of the course's Student Management table so you can see exactly who came from which import.
New users created this way do not know their password. Either send them to the lost password link on your student dashboard, or call wp_new_user_notification( $user_id, null, 'user' ) after creating each account so WordPress emails a set-password link. For more on the command line, see our LifterLMS WP-CLI guide.
Before you tell the client it is done, check three things:
If the wrong people went into the wrong course, the custom trigger lets you undo only that import. llms_unenroll_student() removes a student only when the trigger matches, so paid and earlier enrollments are untouched:
wp eval '
$course = 123;
$trigger = "llmsx_csv_20261030";
foreach ( llms_get_enrolled_students( $course, "enrolled", 500 ) as $uid ) {
if ( llms_unenroll_student( $uid, $course, "cancelled", $trigger ) ) {
echo "Cancelled {$uid}\n";
}
}'
Test the rollback on staging first, and take a database backup before any bulk change on production.
Not in core. You import users with WordPress tools or a plugin, then enroll them with the Users screen, vouchers or a script like the one above.
Yes. Every method here accepts a membership. Members are then auto-enrolled in the membership's courses.
For ongoing syncing rather than a one-off import, an automation tool is a better fit. Zapier has a ready-made LifterLMS template for enrolling people when rows are added to Google Sheets; our Zapier automations guide covers the setup and its limits.
Yes, unless drip settings, a course start date or prerequisites hold back the content.
For a one-off list, import the users and enroll them from the Users screen. For anything recurring, such as a new cohort every term or a feed from an HR system, put the logic in a script or an integration so it is repeatable and auditable instead of a Friday afternoon of ticking boxes.
We build that kind of import and sync for training providers, including validation, logging and rollback. See our LifterLMS development service, or send us a sample of your spreadsheet and we will tell you the fastest safe way to load it.
Where to manually enroll a student in a LifterLMS course or membership, what Cancel, Reactivate and Delete Enrollment each do, how order-based…
Read article
Use LifterLMS sample courses, the importer and the built-in course generator to prototype a course site quickly: import ready-made courses, write a…
Read article
A design-focused guide to the LifterLMS certificate builder in the block editor: page size, orientation, margins, background images, fonts, layout…
Read articleSkip the trial and error. Get specialist LifterLMS help and ship faster.