Skip to content

LifterLMS data model: post types, meta keys and custom tables

Learn how LifterLMS stores courses, lessons, quizzes and orders in the WordPress database, so you can query a live course site with plain SQL. This guide maps each post type, the chain from access plan to order, the _llms_ meta keys that link them, and the wp_lifterlms_ tables that hold student progress.

This guide shows WordPress admins and developers where LifterLMS, a learning management system (LMS) plugin, keeps its course, sales and student data. LifterLMS stores almost everything as ordinary WordPress post types, the same mechanism WordPress uses for posts and pages. Content is course, section, lesson, llms_quiz and llms_question. Commerce is llms_membership, llms_access_plan, llms_order and llms_transaction. Around those sit llms_engagement, llms_email, llms_certificate, llms_achievement, llms_coupon, llms_voucher and llms_form. Almost every link between them is a plain row in wp_postmeta, the table where WordPress keeps extra fields for each post. Those rows use keys that start with _llms_, such as _llms_parent_course, _llms_parent_section, _llms_quiz, _llms_product_id and _llms_plan_id. Student state is the one exception. Enrollment, progress and quiz results go into the plugin’s own tables, chiefly wp_lifterlms_user_postmeta and wp_lifterlms_quiz_attempts.

This clear layout is why LifterLMS is pleasant to operate, because you can answer most questions about a course site with SQL you already know. First you will learn to read the model on a live install. Then you will use it to make the choices that matter once the site earns money. The guide covers four of them. Should you sell through access plans (the pricing options attached to a course or membership) or a price set on the post? Should you use the built-in checkout or WooCommerce? What does the engagement engine, which sends emails and awards certificates, actually react to? And which table grows first?

What you’ll accomplish

  • Enumerate the exact post types your LifterLMS version registers, rather than trusting a list from a blog post.
  • Walk a course from its top-level post down to a single question, following the meta key on each edge.
  • Trace one purchase from access plan to order to transaction to the enrollment row it wrote.
  • Read enrollment and completion state straight out of wp_lifterlms_user_postmeta instead of clicking through the admin.
  • Know which tables grow with student count, and size them before a report times out.

Prerequisites

  • WordPress 6.0 or newer on PHP 7.4 or newer, with LifterLMS 7.x. Post type names have been stable for years; meta keys drift slightly between minor versions, so this page shows you how to confirm them rather than asking you to trust them.
  • WP-CLI over SSH, or any way to run SQL. Every query here also works in phpMyAdmin.
  • Your real table prefix. Everything below assumes the default wp_; substitute yours in both wp_postmeta and wp_lifterlms_user_postmeta.
  • A staging copy for anything that writes. Reads are safe on production; the ordering repairs in Troubleshooting are not.
  • Admin access to the dashboard for cross-checking what the queries return.

How it works

There are three layers, and knowing which layer a fact lives in tells you where to look for it.

The post layer holds everything an administrator authors: courses, sections, lessons, quizzes, questions, memberships, access plans, engagements, emails, certificates. These are real rows in wp_posts, so they have IDs, statuses, revisions and permalinks like any other content.

The meta layer holds the relationships. A section knows its course through _llms_parent_course. A lesson knows its section through _llms_parent_section and carries _llms_parent_course as well, so lesson-to-course lookups do not need a join through sections. Position within a parent is _llms_order, stored as a string, which is why every ordering query below casts it with + 0. A lesson points at its quiz with _llms_quiz, and the quiz keeps the reverse pointer plus its question list.

The student layer is the exception. Enrollment status, start date, completion and the trigger that caused each of them are rows in wp_lifterlms_user_postmeta, keyed by user_id and post_id together. Quiz attempts get their own table. Nothing about a student is written to wp_postmeta.

LifterLMS entity map: course, section, lesson, quiz and question on the left, membership through access plan to order on the right, with the linking meta key on every edge

Read the diagram as containment flowing downward, with each edge labelled by the meta key stored on the lower object. That direction matters when you write queries: to find a course’s sections you search wp_postmeta for _llms_parent_course with the course ID as the value, not for something on the course itself.

Step-by-step

  1. List the post types this install actually registered. Never assume; versions differ and add-ons register more.

    wp post-type list --field=name | grep -E '^(course|section|lesson|llms_)'
    course
    section
    lesson
    llms_membership
    llms_engagement
    llms_certificate
    llms_my_certificate
    llms_achievement
    llms_my_achievement
    llms_email
    llms_quiz
    llms_question
    llms_coupon
    llms_voucher
    llms_order
    llms_transaction
    llms_access_plan
    llms_form

    Note that quiz is llms_quiz, not quiz. Guides that say otherwise are wrong, and a --post_type=quiz flag will silently return nothing.

  2. Size the catalogue. Counts tell you whether you are looking at a brochure site with three courses or a catalogue that will need query care.

    for pt in course section lesson llms_quiz llms_question llms_membership llms_access_plan llms_order; do printf '%-18s %s\n' "$pt" "$(wp post list --post_type=$pt --post_status=any --format=count)"; done
    course             34
    section            212
    lesson             1486
    llms_quiz          309
    llms_question      2740
    llms_membership    4
    llms_access_plan   61
    llms_order         3122
  3. Walk one course down to its lessons. Pick a course ID from wp post list --post_type=course, then read its sections in display order.

    wp db query "SELECT p.ID, p.post_title, o.meta_value AS position FROM wp_posts p JOIN wp_postmeta c ON c.post_id = p.ID AND c.meta_key = '_llms_parent_course' AND c.meta_value = '42' LEFT JOIN wp_postmeta o ON o.post_id = p.ID AND o.meta_key = '_llms_order' WHERE p.post_type = 'section' ORDER BY o.meta_value + 0;"
    ID   post_title            position
    108  Getting set up        1
    131  Core concepts         2
    166  Putting it together   3

    Then the lessons inside one section, with the quiz each one links to:

    wp db query "SELECT p.ID, p.post_title, q.meta_value AS quiz_id FROM wp_posts p JOIN wp_postmeta s ON s.post_id = p.ID AND s.meta_key = '_llms_parent_section' AND s.meta_value = '108' LEFT JOIN wp_postmeta o ON o.post_id = p.ID AND o.meta_key = '_llms_order' LEFT JOIN wp_postmeta q ON q.post_id = p.ID AND q.meta_key = '_llms_quiz' WHERE p.post_type = 'lesson' ORDER BY o.meta_value + 0;"
    ID   post_title              quiz_id
    109  Why this matters        NULL
    112  Installing the tools    NULL
    117  Your first run          204
  4. Confirm the meta keys instead of trusting a list. This is the query to keep. It reports what your version really stores, so you never build a report on a key that was renamed two releases ago.

    wp db query "SELECT meta_key, COUNT(*) AS rows_found FROM wp_postmeta WHERE meta_key LIKE '\_llms%' GROUP BY meta_key ORDER BY rows_found DESC LIMIT 25;"
    meta_key                 rows_found
    _llms_order              1698
    _llms_parent_course      1698
    _llms_parent_section     1486
    _llms_quiz               309
    _llms_product_id         61
    _llms_price              61
    ...

    For a single object, wp post meta list is faster than guessing:

    wp post meta list 204 --format=table
  5. Follow the money from plan to product. An access plan is the sellable thing; the course or membership is what it grants. _llms_product_id is the link.

    wp db query "SELECT p.ID AS plan_id, p.post_title AS plan, pr.meta_value AS product_id, t.post_type, t.post_title AS product FROM wp_posts p JOIN wp_postmeta pr ON pr.post_id = p.ID AND pr.meta_key = '_llms_product_id' JOIN wp_posts t ON t.ID = pr.meta_value WHERE p.post_type = 'llms_access_plan' AND p.post_status = 'publish' ORDER BY t.post_type, product_id;"
    plan_id  plan          product_id  post_type        product
    77       Monthly       42          course           Fundamentals
    78       Annual        42          course           Fundamentals
    79       Lifetime      42          course           Fundamentals
    91       All-access    12          llms_membership  Pro members

    One product with several plans is the normal, healthy shape. A course with a price set on the course post and no plan row is the misconfiguration to look for.

  6. Read order state. Order status is the WordPress post status, prefixed llms- — not a meta key.

    wp db query "SELECT post_status, COUNT(*) AS orders FROM wp_posts WHERE post_type = 'llms_order' GROUP BY post_status ORDER BY orders DESC;"
    post_status         orders
    llms-completed      1904
    llms-active         912
    llms-pending        141
    llms-cancelled      98
    llms-failed         52
    llms-expired        15

    Each order carries _llms_user_id, _llms_product_id, _llms_plan_id, _llms_payment_gateway, _llms_order_type and, for recurring plans, _llms_date_next_payment. Individual charges are llms_transaction posts hanging off the order as child posts; confirm the exact linkage on your install with wp post meta list on one transaction before writing a report against it.

  7. Read enrollment out of the custom table. This is where the admin screens get their answers.

    wp db query "SELECT meta_key, meta_value, COUNT(*) AS rows_found FROM wp_lifterlms_user_postmeta WHERE meta_key IN ('_status','_is_complete') GROUP BY meta_key, meta_value ORDER BY rows_found DESC;"
    meta_key      meta_value  rows_found
    _is_complete  yes         18442
    _status       enrolled    2611
    _status       cancelled   204
    _status       expired     96

    _is_complete is written per lesson, section and course, which is why it outnumbers _status by an order of magnitude. The other keys to know here are _start_date, _enrollment_trigger, _completion_trigger, _achievement_earned and _certificate_earned. Group the trigger to see how people are getting in:

    wp db query "SELECT SUBSTRING_INDEX(meta_value, '_', 1) AS trigger_kind, COUNT(*) AS rows_found FROM wp_lifterlms_user_postmeta WHERE meta_key = '_enrollment_trigger' GROUP BY trigger_kind ORDER BY rows_found DESC;"
    trigger_kind  rows_found
    order         2418
    admin         341
    wp            152

    A trigger of order_3117 points straight back at the llms_order post, which is how a refund or a failed renewal reaches through and flips _status.

    LifterLMS order post status flow from pending through active and completed to failed, pending-cancel and expired, with the matching enrollment status

  8. Inventory the custom tables and their size. There are only a handful, and one of them grows with every student action.

    wp db query "SELECT table_name, table_rows, ROUND((data_length + index_length)/1024/1024, 1) AS mb FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name LIKE '%lifterlms%' ORDER BY (data_length + index_length) DESC;"
    table_name                        table_rows   mb
    wp_lifterlms_events               412088       98.4
    wp_lifterlms_user_postmeta        214370       41.2
    wp_lifterlms_quiz_attempts        18904        62.7
    wp_lifterlms_notifications        30112        11.8
    wp_lifterlms_sessions             1204         0.4

    wp_lifterlms_quiz_attempts is often larger on disk than its row count suggests, because each row stores the full answer payload for that attempt. wp_lifterlms_events is the activity log and is the first table worth a retention policy.

  9. Check what the engagement engine is keyed to. Engagements are posts, and their configuration is meta like everything else.

    wp db query "SELECT p.ID, p.post_title, t.meta_value AS trigger_type, e.meta_value AS engagement_type FROM wp_posts p LEFT JOIN wp_postmeta t ON t.post_id = p.ID AND t.meta_key = '_llms_trigger_type' LEFT JOIN wp_postmeta e ON e.post_id = p.ID AND e.meta_key = '_llms_engagement_type' WHERE p.post_type = 'llms_engagement' AND p.post_status = 'publish';"
    ID   post_title              trigger_type        engagement_type
    301  Welcome mail            course_enrollment   email
    305  Course completion cert  course_completed    certificate
    309  Quiz passed badge       quiz_passed         achievement

    This is the honest answer to “do I need a marketing automation plugin for this”. Enrollment, lesson completion, course completion and quiz outcomes already have triggers; keep those native and reserve an external tool for things LifterLMS genuinely does not observe.

Validate it works

Prove the model end to end on one real student. Take a user ID and a course ID, then read every row LifterLMS holds about that pair:

wp db query "SELECT meta_key, meta_value, updated_date FROM wp_lifterlms_user_postmeta WHERE user_id = 87 AND post_id = 42 ORDER BY updated_date;"
meta_key             meta_value    updated_date
_enrollment_trigger  order_3117    2026-06-14 10:22:41
_status              enrolled      2026-06-14 10:22:41
_start_date          yes           2026-06-14 10:24:03

Cross-check that against what the plugin itself reports, which exercises the same code path the front end uses:

wp eval 'var_dump( llms_is_user_enrolled( 87, 42 ) );'
bool(true)

If the table says enrolled and llms_is_user_enrolled() returns bool(false), the discrepancy is caching — flush with wp cache flush and retest before assuming data corruption. Finally, open the student in Students in the dashboard and confirm the same course, the same status and the same start date. Three agreeing sources means your reads are sound.

Troubleshooting

Lessons vanish from the syllabus after an import or duplication. The post exists but its parent pointer does not, so nothing renders it. Find the orphans directly:

wp db query "SELECT p.ID, p.post_title FROM wp_posts p LEFT JOIN wp_postmeta m ON m.post_id = p.ID AND m.meta_key = '_llms_parent_section' WHERE p.post_type = 'lesson' AND p.post_status = 'publish' AND m.meta_value IS NULL;"

Repair by dragging the lesson into a section in the course builder, which rewrites _llms_parent_section, _llms_parent_course and _llms_order together. Setting one key by hand and leaving the others stale is how sites end up with a lesson that appears twice.

Money was taken but the student has no access. The order is stuck at llms-pending because the gateway’s webhook never reached the site. Look for pending orders with a recent date, then check whether your WAF, ModSecurity, or a login-protection rule is rejecting the gateway’s POST. The order row itself is the evidence: a paid charge in the Stripe or PayPal dashboard with no matching llms_transaction post means the notification never landed, not that the charge failed.

A meta key from a tutorial returns nothing. Keys move between versions and add-ons introduce their own. Re-run the discovery query in step 4 and, for one object, wp post meta list <post-id>. Build reports against what the query returns, never against a remembered name.

Course and student dashboards slow down as enrollment grows. Two different causes look identical. Confirm which one you have by comparing table sizes from step 8 with overall wp_postmeta size — if wp_postmeta dwarfs the LifterLMS tables, the LMS is a bystander and the fix is in cleaning up wp_postmeta bloat. If wp_lifterlms_events is the largest object in the database, set a retention window on activity logging instead.

Quiz grades look wrong in bulk. Check the attempt distribution before the questions. Unlimited attempts is the default, so an average grade computed across all rows in wp_lifterlms_quiz_attempts mixes abandoned first tries with passing retakes. Filter on status and take the best or last attempt per student deliberately, according to the rule the quiz is configured with.

When this is the wrong approach

Reading the database is right for reporting, migration and incident work. It is the wrong tool for writing. LifterLMS enrollment goes through functions that fire the engagement triggers, write the enrollment trigger, and touch several rows at once; an INSERT into wp_lifterlms_user_postmeta produces a student who is enrolled but never received the welcome mail or the certificate. Enroll through the admin, the checkout, or the plugin’s own functions.

LifterLMS itself is the wrong choice in a few honest cases. If your requirement list starts with SCORM or xAPI packages, instructor-graded assignments at volume, or SSO into an HR system, a hosted LMS will cost less than the add-ons and glue code. If you are weighing the two common WordPress options rather than operating one, the failure profiles differ more than the feature lists do — LearnDash setup and common issues covers the same ground for the other side. And if there is no assessment at all, only gated content behind a subscription, a membership plugin is a smaller surface to run than an LMS.

On the operational calls this model implies: sell through access plans, never a price on the course post, because orders reference _llms_plan_id and reporting falls apart without it. Keep native checkout unless you already run a WooCommerce catalogue of physical goods — bolting WooCommerce on gives you two order systems and two sources of truth for the same purchase. Set quiz attempt and time limits explicitly at creation, since the defaults are unlimited. And treat the gateway webhook as production infrastructure: if it cannot reach the site, renewals stop translating into access, quietly. The vendor keeps current reference material in the LifterLMS documentation, and hook and function signatures live in the LifterLMS developer documentation.

Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.