# Automating Course and Lesson Creation in WordPress Using LearnDash

**URL:** <https://community.make.com/t/automating-course-and-lesson-creation-in-wordpress-using-learndash/77821>\
**Category:** Questions\
**Tags:** webhooks, mapping\
**Created:** [April 7, 2025, 7:25am UTC](https://community.make.com/t/automating-course-and-lesson-creation-in-wordpress-using-learndash/77821 "2025-04-07T07:25:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![evoluciona](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@evoluciona](https://community.make.com/u/evoluciona)\
**Post date:** [April 7, 2025, 7:25am UTC](https://community.make.com/t/automating-course-and-lesson-creation-in-wordpress-using-learndash/77821/1 "2025-04-07T07:25:59Z")

</div>

### What are you trying to achieve?

I’ve created a scenario that creates a course using the LearnDash module and then creates lessons using the LearnDash module on a WordPress website. The course and lessons are created correctly, but I don’t see how to associate the lessons with the course.

### Steps taken so far

I’ve checked, and it seems that option is not available. Is there any way to perform that association within the scenario? I’ve also tried using the WordPress API call and HTTP modules without success.

Relationship Between Courses and Lessons in LearnDash (MySQL + WordPress)  
This document explains how courses and lessons are related in a WordPress installation using LearnDash, at the database (MySQL) level. It is intended for developers who need to understand how this information is stored internally.

📁 Base Structure: wp\_posts  
Both courses and lessons are Custom Post Types registered by LearnDash:

Course: post\_type = sfwd-courses  
Lesson: post\_type = sfwd-lessons  
🧠 Main Association: wp\_postmeta  
LearnDash uses the wp\_postmeta table to relate lessons to courses using metadata.

Example:  
Course ID: 51896  
Lesson ID: 51907

post\_id meta\_key meta\_value  
51907 course\_id 51896  
51907 ld\_course\_51896 51896  
course\_id → direct relationship  
ld\_course\_51896 → special key LearnDash uses internally  
🛠 PHP Function Handling This  
The official LearnDash function to associate lessons with a course is:

learndash\_set\_course\_steps($course\_id, $lessons, ‘add’);  
🧱 Tables Involved

wp\_posts: Stores courses and lessons as CPTs.  
wp\_postmeta: Stores the relationship between course and lesson (course\_id, ld\_course\_{ID})  
🚫 Tables Not Used by Default

post\_parent  
term\_relationships, term\_taxonomy, or termmeta  
⚙ Additional Considerations

It’s necessary to add course\_id and ld\_course\_{ID} when creating lessons.  
Some themes or modules rely on these metadata entries to display content.

---

<div class="post-metadata">

**Author:** ![Toby\_Potter](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@Toby\_Potter](https://community.make.com/u/Toby_Potter)\
**Post date:** [June 2, 2025, 6:54am UTC](https://community.make.com/t/automating-course-and-lesson-creation-in-wordpress-using-learndash/77821/2 "2025-06-02T06:54:14Z")

</div>

Did you figure this out?

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [August 31, 2025, 7:02am UTC](https://community.make.com/t/automating-course-and-lesson-creation-in-wordpress-using-learndash/77821/3 "2025-08-31T07:02:29Z")

</div>


