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

Start free trial

LearnDash Manage Group Courses

learndash/manage-group-courses adds or removes the courses a group grants.

The reach is the thing to hold in mind: this is a per-member operation wearing the clothes of a per-group one.

At a glance

Abilitylearndash/manage-group-courses
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Groups
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Pro 0.9.16 and later

How it works

Adding a course grants it to every member of the group at once. Removing one revokes it from every member at once — unless they hold that course directly as well, in which case their own enrolment survives.

So a group with four hundred members is four hundred grants or revocations from a single-line call, and the response reports how many members were affected.

This is incremental. Pass add and remove as arrays; anything you do not mention is left alone. That makes a single change a single call, and it means a caller cannot wipe a list by sending a short one.

Learner progress is never deleted by any of this. A course revoked and later re-granted returns the learner to exactly where they were, which makes membership changes safe in the way that learndash/reset-user-progress is not.

Read learndash/list-group-members first when the member count matters, which is most of the time.

Idempotent.

Input

NameTypeRequiredWhat it is
group_idintegerYesThe group.
addarrayNoCourse post IDs to grant.
removearrayNoCourse post IDs to stop granting.

What comes back

NameTypeWhat it is
coursesarrayThe courses the group grants afterwards.
members_affectedintegerHow many members gained or lost access.
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:

Add the advanced course to this cohort.

It resolves to one call:

{
  "ability": "learndash/manage-group-courses",
  "parameters": {
    "group_id": 700,
    "add": [418]
  }
}

Worth knowing

  • One call grants or revokes for every member.
  • A directly held course survives a group revocation.
  • Incremental — unmentioned courses stay assigned.
  • Progress is never deleted.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading