Skip to content
Building

How to Create an Online Course Platform with WooCommerce and LMS Integration

· · 9 min read
How to Create an Online Course Platform with WooCommerce and LMS Integration

Every time I quote a client for a WooCommerce LMS integration, the conversation starts the same way: they have looked at Teachable or Thinkific, decided those platforms do not give them enough control over the purchase flow and pricing, and now want to run their courses through WooCommerce instead. That is the right instinct. WooCommerce gives you full control over coupons, upsells, subscription billing, and the checkout experience. The LMS plugin then handles the course content, student progress, and certificates. This guide covers how to connect those two pieces in a way that actually holds up when you have hundreds of students and need to sell to corporate buyers with group licenses.


Choosing Between LearnDash and LifterLMS

These are the two LMS plugins I have used in production. Both have mature WooCommerce integrations and active development teams. The choice usually comes down to specific feature requirements:

  • LearnDash is the more popular choice and has a larger add-on ecosystem. Its WooCommerce integration (LearnDash Woocommerce Integration add-on) is official and works by connecting WooCommerce product purchases to LearnDash course access. The focus and quiz engines are strong. The group management for corporate enrollments is functional but requires the Groups add-on.
  • LifterLMS has a built-in payment system but also has a WooCommerce integration. Its student management and progress reporting are strong out of the box. The memberships and certificates are included in the core plugin rather than requiring separate add-ons.

For most client projects I recommend LearnDash when the client already has a WooCommerce store and wants to add courses. I recommend LifterLMS when the course business is the primary product and the client does not need deep WooCommerce integration for their existing catalog.


Course as a Product: The Integration Model

LearnDash WooCommerce Integration

The official LearnDash WooCommerce integration works by hooking into the WooCommerce order completion flow. You create a WooCommerce product for each course (or a bundle product covering multiple courses), then in the LearnDash course settings you link that product to the course. When an order completes, the integration automatically enrolls the customer in the linked course.

The integration also handles refunds: if the WooCommerce order is refunded, the course access is removed. This is the behavior you want for most setups. One edge case is partial refunds on bundle orders – if a customer bought a three-course bundle and requests a refund for one course, the integration removes all course access. You need custom logic to handle partial refund scenarios if that is a business requirement.

Product Variations for Course Tiers

A common course product structure is to sell tiers: Basic (course access only), Premium (course plus community), VIP (course plus community plus 1-on-1 coaching call). Implement this with WooCommerce product variations. Each variation maps to a different set of LearnDash courses or groups. The variation meta stores the LearnDash course IDs or group IDs to enroll on purchase. The order completion hook reads the variation meta and makes the enrollment calls accordingly.

Subscription-Based Course Access

For ongoing access models (pay monthly, access all courses), combine WooCommerce Subscriptions with LearnDash groups. Create a LearnDash group that contains all your courses, then add a WooCommerce subscription product that grants group membership on purchase and removes it on subscription cancellation or expiry. Hook into woocommerce_subscription_status_active to add the student to the group, and woocommerce_subscription_status_cancelled to remove them.

Subscription renewals need careful handling. If a payment fails and the subscription moves to an on-hold status, decide whether to keep course access during the grace period or suspend it immediately. Most clients prefer a 3-day grace period before suspending: hook into woocommerce_subscription_status_on-hold and schedule a WP-Cron job for 72 hours later to actually revoke access if the subscription is still on-hold. If the payment recovers and the subscription reactivates within that window, cancel the scheduled job.


Drip Content Configuration

LearnDash Drip Settings

LearnDash has built-in drip content at the lesson level. You can set each lesson to become available a fixed number of days after the student enrollment date. This is the most common drip pattern for self-paced courses – enroll on day 1, week 1 content unlocks immediately, week 2 content unlocks after 7 days, and so on.

The drip settings also support scheduled dates (a lesson becomes available on a specific calendar date regardless of enrollment date), which is useful for cohort-based courses where everyone starts the same week. For a cohort model, set the drip type to Lesson Available On with a fixed date for each lesson.

Custom Drip Logic

The built-in drip settings cover most cases, but I have built custom drip logic for clients who need milestone-based unlocking rather than time-based. The most common request is Lesson 3 unlocks only after the student completes the quiz at the end of Lesson 2. For milestone-based drip, hook into the learndash_lesson_completed action, check whether the completed lesson was a prerequisite for another lesson, and update the drip availability date on the next lesson to the current date.


Quiz and Certificate Setup

LearnDash Quiz Engine

LearnDash has a solid quiz builder with multiple question types: multiple choice, true/false, free-form text, essay, fill-in-the-blank, sorting, and matching. Quizzes can be set to require a passing score before the student proceeds, or they can be informational (no pass/fail). Setting a pass percentage and enabling the Lock Quiz option blocks course progression until the student passes.

For certification courses where the quiz result matters legally or professionally, store quiz attempts and scores in a custom table rather than relying solely on LearnDash user meta storage. User meta scales poorly when you have thousands of students with multiple quiz attempts each. A custom table with student_id, quiz_id, attempt_date, score, and pass/fail allows indexed queries for reporting.

Timed quizzes are a common requirement for compliance training. LearnDash supports time limits on quizzes, but the timer runs client-side in JavaScript. For high-stakes quizzes where gaming the timer is a concern, record the quiz start time server-side when the student loads the quiz page and validate on submission that the elapsed time falls within the allowed window.

Certificate Generation

LearnDash generates PDF certificates on course completion. You define a certificate template (HTML/CSS), and LearnDash fills in the student name, course name, and completion date. The default system uses dompdf for the PDF generation. For certificates that need custom design beyond what the LearnDash template system supports, replace the PDF generation with a custom implementation.


Student Progress Tracking

LearnDash Progress Data

LearnDash stores student progress in WordPress user meta. The main meta keys are: _sfwd-course_progress (tracks which lessons and topics are completed for each course) and _sfwd-quizzes (stores quiz attempt data). These meta keys hold serialized arrays, which makes direct database querying difficult at scale.

For reporting dashboards that need to show completion rates across all students, do not query user meta directly for each student. Instead, build a denormalized reporting table that stores summary progress records: student_id, course_id, lessons_completed, lessons_total, last_activity, completion_date. Update this table via a hook on learndash_lesson_completed and learndash_course_completed.

Instructor Dashboards

If your platform has multiple instructors (each managing their own courses), you need an instructor-facing dashboard. I build a custom WP admin page for instructors using the denormalized progress table – it shows enrollment counts, average progress, completion rates, and quiz scores per course. Add an export function so instructors can pull a CSV of student progress for their own records or to share with an employer who needs completion reports.


Group Enrollments for Corporate Buyers

The Group Model

Corporate buyers typically want to buy course access for their team and then manage enrollment themselves rather than having each employee purchase individually. In LearnDash, this maps to the Groups feature: you create a LearnDash group, add courses to the group, and add employees as group members. The group leader (the HR manager or training coordinator) can add and remove members from the group through a front-end group management interface.

The WooCommerce product for a group license is a simple or variable product where the variation defines the seat count: 10-seat license, 25-seat license, 50-seat license. On purchase, create the LearnDash group automatically with the seat limit set to the purchased count. Store the group ID in the order meta so the group leader can be identified and directed to the group management page.

Custom Group Management Front End

LearnDash default group management interface is basic. Corporate clients expect something cleaner: a dashboard where they can see all their seats, who is using each seat, and add or remove people by email address. I build this as a custom WooCommerce My Account endpoint – the same pattern used for license management dashboards in plugin shops. If you are also selling software alongside your courses, our guide on WooCommerce license key generation covers the same My Account endpoint pattern for seat-based access management.


Course Upsells and Bundles

WooCommerce handles course upselling the same way it handles product upselling: linked products shown on the course product page. For course platforms, the more effective patterns are:

  • Post-purchase upsell: After completing course A, show an offer to purchase course B at a discount. Trigger this from the learndash_course_completed hook – store the completion event, then display a WooCommerce-powered offer on the student dashboard.
  • Bundle discounts: A WooCommerce grouped product or a custom bundle that offers 3 courses at the price of 2. The bundle product links to all three course products for enrollment purposes.
  • Subscription upsell: Students who have purchased individual courses and are close to spending the equivalent of an annual subscription should see a prompt to switch to the subscription.

Handling Course Access After Refund Window

Most course platforms offer a 30-day refund window. The challenge is that a determined student can complete the course in the first week and then request a refund on day 25. To mitigate this, track course completion percentage and set a policy: refunds are not available after the student has completed more than 30% of the course content. Enforce this in the WooCommerce refund flow by checking the student LearnDash progress when a refund is requested through My Account.


Performance at Scale

Course platforms have a specific traffic pattern: low traffic most of the time, spikes when a new course launches or when an email campaign goes out. The lesson page is the most visited page and needs to load fast. Three things that help:

  • Object caching. LearnDash makes multiple user meta queries per lesson page load to check access permissions. With object caching (Redis or Memcached), these queries hit cache after the first request. Without caching, a lesson page load can trigger 15-20 database queries just for the access checks.
  • Separate the marketing site from the LMS. The public course catalog and sales pages can be aggressively cached. The lesson pages cannot be cached (they are personalized per student). Run the public pages through a CDN or page cache and exclude the lesson URL pattern from caching.
  • LearnDash transient caching. LearnDash has a built-in transient cache for course and lesson data. Enable it in LearnDash > Settings > Advanced. This reduces the number of database queries for course structure lookups.

Checkout Experience for Course Sales

The checkout experience for courses differs from physical products in a few important ways. Students often want to review the course curriculum before buying – the product page needs a detailed lesson list with locked lesson indicators for content they cannot access before enrolling. Preview lessons (free samples) are a standard expectation.

The checkout should not ask for a shipping address. Add a filter to remove shipping fields from the WooCommerce checkout for course-only orders. Check the cart contents: if all products have a custom digital only flag (set via product meta), remove the shipping fields with woocommerce_checkout_fields. Students buying a mix of physical merchandise and courses still need shipping – the filter should be conditional, not global.


Integration with the Rest of WooCommerce

One of the main reasons to build on WooCommerce rather than a standalone LMS platform is access to the WooCommerce ecosystem. A few integrations that add real value on course platforms:

  • WooCommerce coupons for course launches. Time-limited launch discounts and early-bird coupons work out of the box. No custom code needed.
  • Affiliate programs via WooCommerce affiliate plugins. Affiliates earn a commission on course sales, tracked through WooCommerce order attribution.
  • Email marketing integration. Tag students in your email list based on which courses they are enrolled in, using WooCommerce email platform integrations (Mailchimp, ConvertKit, ActiveCampaign).
  • WooCommerce Analytics for course revenue reporting. Course products appear in WooCommerce Analytics like any other product, giving you revenue per course, refund rates, and customer lifetime value by course.

The patterns for extending WooCommerce product data for courses parallel the general approach for any custom product type. Our guide on building custom WooCommerce product types covers the base class architecture that applies when you need LearnDash course enrollment to behave differently from a physical product in the cart and fulfillment flow.

This series also covers other WooCommerce industry configurations. If you are building for the food and beverage space, see our guide on setting up WooCommerce for food delivery with zone-based ordering, which walks through the same kind of custom business logic needed when standard WooCommerce assumptions do not match your industry requirements.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *