Update LearnDash Course
Changes a LearnDash course: its title, description, excerpt, status, access mode (price_type) or price. Only the fields passed are changed; everything else is left as it is. Returns each changed field's previous and current value. Reversible by calling again with the previous values. Setting status to "publish" makes the course visible to visitors. Get the course ID from mosmcp/learndash-list-courses.
Also known as: edit course, rename course, change course price, publish course, unpublish course.
| Property | Value |
|---|---|
| Ability slug | mosmcp/learndash-update-course |
| Wire tool name | mosmcp__learndash-update-course |
| Category | LearnDash (mosmcp-learndash) |
| Plan | Pro |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_posts, plus the LearnDash course post type's edit_posts capability (edit_courses) and edit_post on the course (checked in the code) |
| Minimum default role | Contributor |
| Annotations | readOnly: false · destructive: false · idempotent: true · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| course_id | integer (min 1) | Yes | — | The LearnDash course ID, as returned by mosmcp/learndash-list-courses. |
| title | string (min length 1) | — | New course title. | |
| description | string | — | New course description. An empty string clears it. HTML is saved the way the WordPress editor saves it: a user with the unfiltered_html capability can save any markup, including forms, scripts and styles, and markup a user is not allowed to save is refused with the reason rather than silently removed. Backslashes are kept. | |
| excerpt | string | — | New short summary. An empty string clears it. | |
| status | string (one of publish, draft, pending, private) |
— | New status: publish (visible), draft, pending (waiting for review) or private. | |
| price_type | string (one of open, free, paynow, subscribe, closed) |
— | How people get access: open (anyone, no sign-up), free (anyone who enrolls, logged in), paynow (a one-time price, needs price), or closed (only people enrolled by an admin, a group or an order). subscribe (a recurring price) is accepted only for a course that is already a subscription course, because its billing cycle is set up in LearnDash itself. | |
| price | number | null (min 0) | — | The course price in the site's currency, used by price_type paynow and subscribe. At most two decimals. null clears it. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| course | object | Yes | |
| course.course_id | integer | Yes | |
| course.title | string | Yes | |
| course.status | string | Yes | |
| course.price_type | string | open, free, paynow, subscribe or closed; empty when LearnDash has none stored. | |
| course.price | number | null | The stored price, or null when none is set. | |
| course.lesson_count | integer | ||
| course.topic_count | integer | ||
| course.quiz_count | integer | ||
| course.author | string | ||
| course.created_at | string | ||
| course.edit_url | string | LearnDash's course editor, where the course builder is. | |
| course.view_url | string | ||
| changed | object[] | Yes | The fields that changed. Long text is shortened here. |
| changed[].field | string | Yes | |
| changed[].previous | string | number | null | Yes | |
| changed[].current | string | number | null | Yes | |
| warnings | object[] | Notes about the save, such as markup that could not be kept. | |
| warnings[].code | string | ||
| warnings[].message | string | ||
| warnings[].context | string | ||
| notes | string[] |
Example
Sample prompt
Publish LearnDash course 512 and lower its price to 59.
Example request (json)
{
"jsonrpc": "2.0",
"id": 678,
"method": "tools/call",
"params": {
"name": "mosmcp__learndash-update-course",
"arguments": {
"input": {
"course_id": 512,
"status": "publish",
"price": 59
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 678,
"result": {
"isError": false,
"structuredContent": {
"course": {
"course_id": 512,
"title": "Python for Analysts",
"status": "publish",
"price_type": "paynow",
"price": 59,
"lesson_count": 6,
"topic_count": 14,
"quiz_count": 2,
"author": "Priya Shah",
"created_at": "2026-11-02 16:40:11",
"edit_url": "https://example.com/wp-admin/post.php?post=512&action=edit",
"view_url": "https://example.com/courses/python-for-analysts/"
},
"changed": [
{
"field": "status",
"previous": "draft",
"current": "publish"
},
{
"field": "price",
"previous": 79,
"current": 59
}
],
"warnings": [],
"notes": []
}
}
}
Edge cases / errors
- None of title, description, excerpt, status, price_type or price given → mosmcp_learndash_nothing_to_change. Values the course already has leave changed empty, with a note.
- status "publish" or "private" without the right to publish courses → mosmcp_learndash_cannot_publish; set "pending" to send it for review instead.
- No right to edit that course → mosmcp_learndash_cannot_edit_course; ID that is not a LearnDash course → mosmcp_learndash_course_not_found; a trashed course → mosmcp_learndash_course_trashed.
- Switching to price_type "subscribe" → mosmcp_learndash_subscription_unsupported; a paynow course left without a price above 0 → mosmcp_learndash_price_required.
| << Previous | Next >> |
|---|---|
| List LearnDash Groups |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.