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

Start free trial

LearnDash Delete Quiz

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

The ProQuiz half survives, which is unusual among deletions and worth knowing.

Before you run it

The quiz’s questions and any recorded attempts are not deleted by this — LearnDash stores them against the linked ProQuiz record, which survives. The quiz is removed from every course outline that contained it, and the response lists which. Prefer force=false, which trashes the post and is reversible. Permanent deletion is the option that needs a reason.

At a glance

Abilitylearndash/delete-quiz
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Lessons, Topics & Quizzes
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyDestructive — requires confirm_title. Questions and recorded attempts 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

A quiz is a post plus a ProQuiz record. Deleting the post leaves the ProQuiz record, its questions and every recorded attempt in place.

That is not obviously right or wrong. The attempt history is real assessment data and destroying it silently would be worse; leaving it means the site accumulates orphaned ProQuiz records that nothing points at.

Either way it is worth knowing, because “I deleted the quiz” does not mean the learner attempt records are gone — they are still in the statistics tables.

The quiz is removed from every course outline that contained it, which on a shared assessment is more courses than the caller was thinking about.

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
quiz_idintegerYesThe quiz.
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
quiz_idintegerThe quiz.
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 quiz.

It resolves to one call:

{
  "ability": "learndash/delete-quiz",
  "parameters": {
    "quiz_id": 640,
    "confirm_title": "Final assessment"
  }
}

Worth knowing

  • Questions and attempt records survive against the ProQuiz record.
  • Deleting the quiz does not remove learner assessment history.
  • Removed from every course it was in.
  • Trashing is reversible.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading