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

Start free trial

LearnDash Delete Question

learndash/delete-question permanently deletes a question and its linked ProQuiz record. It requires confirm_title matching the current title.

Unlike every other deletion in this suite, there is no trash option.

Before you run it

There is no trash step here, and that is deliberate: a trashed question stays in the quiz’s question map and leaves the quiz pointing at something that is no longer there — which breaks the quiz for every learner rather than merely removing a question. So this deletes outright, and it is irreversible. Recorded learner attempts that referenced the question are not removed.

At a glance

Abilitylearndash/delete-question
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Questions
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyDestructive and irreversible — there is no trash step, by design. Requires confirm_title.
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

Trashing a question would leave it in the quiz’s question map while making the post unavailable — so the quiz would reference a question that cannot be loaded, and learners would meet an error rather than a shorter quiz.

Deleting outright removes it from the map as well, which is the only clean outcome.

That means the operation is irreversible, and the confirmation is the only gate.

It goes through LearnDash’s REST controller for the same reason learndash/manage-question does: both halves of the record need cleaning up, and only the controller does both. LearnDash’s REST API therefore has to be enabled.

Recorded learner attempts that referenced this question are not removed. Past attempt records keep their scores, which is right — an attempt is a historical fact — and it does mean reporting can reference a question that no longer exists.

Not idempotent.

Input

NameTypeRequiredWhat it is
question_idintegerYesThe question.
confirm_titlestringYesMust exactly match the current title on the live record.
confirmbooleanYes — must be trueThe irreversibility gate. Without it the call is refused before anything is touched.

What comes back

NameTypeWhat it is
question_idintegerThe question deleted.
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:

Remove that question from the quiz.

It resolves to one call:

{
  "ability": "learndash/delete-question",
  "parameters": {
    "question_id": 660,
    "confirm_title": "Which shortcut opens the command palette?"
  }
}

Worth knowing

  • No trash, because a trashed question breaks the quiz for everyone.
  • Irreversible — the confirmation is the only gate.
  • Requires LearnDash’s REST API.
  • Past attempt records survive and may reference it.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading