CSV Session Import
18 — CSV Session Import
🔒 Pro feature — requires Dantian Training Hub Pro.
The CSV Import page creates tutorial and clinic sessions in bulk from a spreadsheet. Use it to load a whole term’s timetable at once, or to bring across sessions from another system, instead of adding them one by one on Manage Sessions.
It imports sessions, not attendance. Each row becomes one scheduled tutorial or clinic. Student attendance is then marked as normal on Mark Attendance. There is no tool for importing historical attendance marks.
Where to find it
Training Hub → CSV Import
Administrators only (the manage_options capability). Trainers do not see this page. Without Pro there is no CSV Import menu.
The CSV format
Click Download Import Template for a ready-made file. It has one header row with these columns, plus an example row. Column names are not case-sensitive. Expand Field reference on the page for the same information.
| Column | Required | Description | Example |
|---|---|---|---|
type |
Yes | tutorial or clinic — one type per row; a file can mix both |
tutorial |
course_id |
Yes | The ID of an existing course (the number shown as post= in the course’s edit-screen address) |
123 |
date |
Yes | YYYY-MM-DD, in your site’s time zone. Must be a real calendar date |
2026-03-10 |
time |
No | Start time, HH:MM 24-hour, 00:00–23:59 |
09:00 |
duration_minutes |
No | Session length. Blank = 60 minutes | 90 |
location |
No | Venue name, imported as written. Use the exact name of one of your venues so durations and online/in-person flags match | Room 2 |
capacity |
No | Clinics only. Blank = 5 places | 6 |
instructor_email |
Tutorials: yes. Clinics: no | Email address of an existing WordPress user who will be the trainer or supervisor | mei.lin@example.edu.au |
notes |
No | Note shown with the session (for clinics, visible to students choosing preferences) | Week 1 — Postural assessment |
Example:
type,course_id,date,time,duration_minutes,location,capacity,instructor_email,notes
tutorial,123,2026-03-10,09:00,180,Room 2,,mei.lin@example.edu.au,Week 1 — Postural assessment
tutorial,123,2026-03-17,09:00,180,Room 2,,mei.lin@example.edu.au,Week 2 — Soft tissue
clinic,123,2026-03-13,13:00,240,Student Clinic,5,dr.patel@example.edu.au,Bring uniform and linen
Save the file as CSV (UTF-8) from Excel, Numbers or Google Sheets. The file must be 5 MB or smaller, and only the first 500 data rows are read; split longer timetables into several files. Blank lines are ignored.
Importing step by step
- Go to Training Hub → CSV Import.
- Under Upload CSV, choose your CSV File and click Preview & Validate. Nothing is saved at this stage.
- Review the Import Preview. The header tells you “N valid row(s) ready to import, N row(s) with errors.” Each row shows Row, Type, Course, Date, Time, Duration, Location, Capacity, Instructor and Status (Valid, or Invalid: with the reasons).
- If there are errors, fix them in your spreadsheet and upload again, or carry on: only valid rows are imported.
- Click Import N Valid Row(s) (or Cancel). You will see “Successfully imported N row(s).”
- Check the new sessions on Training Hub → Manage Sessions or the Admin Calendar.
The preview is kept for 10 minutes. If you wait longer you will see “No preview data found. Please upload the CSV again.”
What happens on import
- Tutorial rows create scheduled tutorials with the trainer, location, note and an end time worked out from the start time and duration. Training Hub also schedules that course’s pre-session reminders.
- Clinic rows create Open clinics with the given capacity and supervisor.
- Overlapping tutorials are skipped. If a tutorial row overlaps an existing tutorial or clinic in the same course on the same day (or an earlier row in the same file), it is not imported. Skipped rows are not counted in “Successfully imported N row(s)”, so compare that number with your valid rows.
- Imports cannot be undone in one step. To remove imported sessions, delete them on Manage Sessions (sessions with attendance cannot be deleted).
- Imported sessions behave exactly like hand-made ones: they appear on calendars, Mark Attendance, reminders and reports.
Validation messages
| Message | Meaning |
|---|---|
| Unknown type — use “tutorial” or “clinic” | The type cell is blank or misspelt |
| Invalid course_id | No course with that ID exists |
| Invalid date (use a real calendar date, YYYY-MM-DD) | Wrong format or impossible date (e.g. 2026-02-30) |
| Invalid time (use HH:MM, 00:00–23:59) | Wrong time format |
| Instructor email is required | A tutorial row has no instructor_email |
| Instructor email not found: … | No WordPress user has that email |
| CSV file exceeds the 5 MB limit. | Split the file |
| File is not a valid CSV. / The CSV file is empty. / The CSV file contains no data rows. | Re-save the file as CSV with a header row and at least one data row |
Importing with WP-CLI
For very large timetables, administrators with server access can run:
wp dthub import-tutorials /path/to/sessions.csv --dry-run
wp dthub import-tutorials /path/to/sessions.csv
--dry-run validates without saving. This command imports tutorial rows only (every row is treated as a tutorial). Use the CSV Import page for clinics.
Worked example
A Melbourne college loads Semester 1 for two cohorts.
- The administrator downloads the template and fills 36 rows: 28 weekly tutorials (two courses) and 8 Friday clinics with capacity 6.
- Preview & Validate reports “34 valid row(s) ready to import, 2 row(s) with errors” — one trainer email has a typo and one date is 2026-04-31.
- She fixes both in the spreadsheet, uploads again (36 valid) and clicks Import 36 Valid Row(s).
- “Successfully imported 35 row(s)” — one tutorial was skipped because it overlapped a session she had already created by hand. She checks Manage Sessions and finds the duplicate date.