30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

LearnDash Delete Topic

learndash/delete-topic permanently deletes or trashes a topic.

Like lessons, it affects every course the topic was in.

Before you run it

Quizzes nested under the topic are not deleted — they survive as orphans. The topic is removed from every course outline that contained it, and the response lists which. To remove a topic from one course without deleting it, use learndash/detach-step. Prefer force=false, which trashes the post and is reversible. Permanent deletion is the option that needs a reason.

At a glance

Abilitylearndash/delete-topic
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Lessons, Topics & Quizzes
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyDestructive — requires confirm_title. Nested quizzes are not deleted.
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Pro 0.9.16 and later

How it works

LearnDash does not cascade deletions down a course outline. Steps nested under what you delete survive as orphans — still in the library, attached to nothing, invisible to learners and easy to lose track of.

For a topic that means its quizzes — which are frequently the part with learner attempts recorded against them, and which will now be unreachable while those records persist.

That combination is worth avoiding: a quiz nobody can take, holding attempt history that still appears in reporting.

Detaching from one course is the narrower operation and leaves the topic intact everywhere else.

Prefer force=false, which trashes the post and is reversible. Permanent deletion is the option that needs a reason.

Not idempotent.

Input

NameTypeRequiredWhat it is
topic_idintegerYesThe topic.
confirm_titlestringYesMust exactly match the current title on the live record.
forcebooleanNoTrue deletes permanently; false trashes.
confirmbooleanYes — must be trueThe irreversibility gate. Without it the call is refused before anything is touched.

What comes back

NameTypeWhat it is
topic_idintegerThe topic.
affected_coursesarrayEvery course outline it was removed from.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Delete that topic.

It resolves to one call:

{
  "ability": "learndash/delete-topic",
  "parameters": {
    "topic_id": 560,
    "confirm_title": "Keyboard shortcuts"
  }
}

Worth knowing

  • Nested quizzes survive, unreachable, with their attempt history intact.
  • Removed from every course it was in.
  • Detaching is the single-course alternative.
  • Trashing is reversible.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading