Skip to content

Bulk Enroll from a List

Learnomy overviewFree + ProGet Learnomy →

Bulk enroll lets you add many students to a course at once by pasting a list of email addresses or uploading a CSV file. It runs from the course detail screen in wp-admin, creates accounts for people who do not have one yet, and gives manual access to people who already have the course another way, so it stays if that other access ends.

  • Enroll a whole list of students in one course in a single action instead of adding them one by one.
  • Paste email addresses straight into a box, one per line or separated by commas.
  • Upload a CSV (or plain text) file of email addresses instead of pasting.
  • Automatically create an account for any email that does not have one yet, and send that person a set-password invite so they can log in.
  • Give manual access to anyone who already has the course another way (a purchase, a plan), so refunding the purchase later does not take away the access you gave. Someone who already has manual access is skipped, so re-running the same list never double-enrolls or double-charges.
  • See a per-run summary that tells you how many were enrolled, how many new accounts were invited, how many already had the course another way and now also have manual access, how many already had manual access, and how many failed.
  • Grant access to a course set to Access granted externally (closed) without a payment step, since these courses are not sold on your site.

Bulk enroll section on the course detail screen

Go to Learnomy -> Courses, then open the course you want to enroll people into. This opens the course detail screen (?page=learnomy-course-detail&course_id=<course id>).

Scroll to the Enroll a student card. Below the single-student email box there is a collapsible row labelled Bulk enrol from a list (CSV / emails). Click it to expand.

You have two ways to supply the list, and you can use either one:

  • Paste the addresses into the text box, one email per line or comma-separated. Whitespace, commas, and semicolons between addresses all work as separators.
  • Upload a file by clicking Choose CSV and picking a .csv or plain text file. Its contents are read into the same text box, so you can review or edit the list before submitting.

Quotes around a CSV cell, Name <address>, brackets and trailing dots or commas are fine, names and header cells are ignored, and duplicate addresses are collapsed to one (matching is case-insensitive), so a messy list is fine.

An entry that has an @ but is not an email address as typed (for example joe@@example.com) is skipped, never guessed at. The result says how many were skipped and names the first few, so you can correct and add them.

Click Enrol everyone. Learnomy processes the list and, for each address:

  • If the person already has manual access to the course, they are skipped.
  • If the person already has the course another way (a purchase, a membership plan), they also get manual access, and the summary says so.
  • If the person already has an account but is not enrolled, they are enrolled (source: manual).
  • If the email has no account yet, Learnomy creates one and sends a set-password invite, then enrolls the new account.

When the run finishes, a summary line appears under the button, for example: how many were enrolled, how many new accounts were invited, how many already had the course another way and now also have manual access, how many already had manual access, and how many failed.

If your list was longer than the per-request cap (500 by default), or your host would not allow enough time for all of it in one go (creating many new accounts takes a while), the summary tells you how many are left to do and asks you to submit again to continue. The text box then holds exactly the addresses still to do, so keep clicking Enrol everyone until nothing is left. Nobody is enrolled or invited twice.

The bulk enroll controls live inside the Enroll a student card on the course detail screen. The fields are:

Control What it does
Bulk enrol from a list (CSV / emails) The collapsible section that holds the whole feature.
Choose CSV File picker. Accepts .csv, text/csv, and text/plain. The file is read into the text box.
Email text box Paste target. One email per line or comma / semicolon / whitespace separated.
Enrol everyone Submits the list to the bulk enroll endpoint.

Behavior worth knowing:

  • Source is manual. Every seat created this way is recorded with source = manual, which bypasses payment. Use it for teams, cohorts, comped access, or closed courses.
  • Students who already have manual access are skipped, so re-submitting the same list is safe.
  • New emails are provisioned with an account plus a set-password invite, the same way the incoming enrollment webhook provisions first-time buyers.
  • Per-request cap. At most 500 addresses are processed per submission. Anything beyond that stays in the text box and is reported as “left to do”, so submitting again does the rest. The cap is adjustable with the learnomy_bulk_enroll_max filter.
  • Time limit per request. A submission stops by itself after two thirds of your host’s PHP time limit, 20 seconds at most, and leaves the rest in the text box the same way. On a stock 30 second host that is usually around 75 to 150 new accounts per submission; people who already have an account are much quicker.

REST route (under the learnomy/v1 namespace, admin only):

  • POST /admin/courses/{id}/bulk-enroll – enrolls a list of emails into course {id}. Permission callback is is_admin. Body param emails is a required array of strings (each string may itself contain several addresses; the handler splits on whitespace, commas, and semicolons, checks each address as typed, and dedupes). Optional boolean stop_before_time_limit (default false): send true only if you read remaining_emails and send those again; the request then stops before the host’s PHP time limit and returns the rest there. Without it the whole list is processed, up to the cap, however long it takes. Returns a summary object (enrolled, created, also_manual, skipped, failed, refused), a message with the summary in words, a per-email rows array, a refused array (what was typed, for the entries with an @ that are not addresses; they are not in rows), a remaining count for anything past the cap, and remaining_emails, the addresses themselves: send those in the next request.

Filter:

  • learnomy_bulk_enroll_max – the maximum number of addresses processed per request. Defaults to 500. Addresses past it come back in remaining_emails.
  • learnomy_bulk_enroll_seconds – the seconds a request sent with stop_before_time_limit works before it stops and returns the rest. The course screen sends it; other callers are not stopped by time. Defaults to two thirds of PHP’s max_execution_time, 20 at most (20 when there is no limit). At least one address is always processed, so even 0 moves on.

Under the hood the handler resolves or creates each account through Provisioning_Service::ensure_user_by_email() (the same path a guest checkout and the incoming sales webhook use) and enrolls through Enrollment_Service::enroll( $user_id, $course_id, 'manual' ). Already-active seats are detected with Enrollment::find_active().