events/trash-venue moves a venue to the trash. It refuses without confirm: true.
It reports how many events still link to the venue, because nothing else is going to tell you.
Before you run it
Events linked to this venue are not updated. The calendar leaves them pointing at a trashed post, and their venue section goes blank on the front end. The response tells you how many events are affected, but it tells you as it acts — read the count with events/list-events first if you want to decide before anything moves.
At a glance
| Ability | events/trash-venue |
| Toolset | The Events Calendar — toolset/events-calendar |
| Group | The Events Calendar › Venues |
| Requires | The Events Calendar, active on the site |
| Capability | manage_options |
| Safety | Destructive — moves the post to the trash, and refuses to run without confirm: true. Recoverable from the WordPress trash. |
| Repeatable | Not idempotent — each call changes the row set, so re-running is not a no-op |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
How it works
The Events Calendar does not clean up after a trashed venue. Events keep the venue ID in their meta, the venue post is in the trash, and the event page renders with an empty venue section. No warning in the admin, no notice anywhere.
So the count comes back with the result: how many events were pointing at this venue when it went. On a calendar with years of history that number is often much larger than the person asking expects, and it is the number that tells you whether this was a tidy-up or a mistake.
Trash only, never permanent deletion — for the same reason as events. A venue is a custom post type, and WordPress will not auto-trash one; the default deletion path would remove it and its meta outright.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
id | integer | Yes | The venue ID. |
confirm | boolean | Yes — must be true | The irreversibility gate. Without it the call is refused before anything is touched. |
What comes back
| Name | Type | What it is |
|---|---|---|
id | integer | The venue ID. |
trashed | boolean | Whether the move succeeded. |
linked_events | integer | How many events still reference this venue. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present 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 the duplicate venue 311.
It resolves to one call:
{
"ability": "events/trash-venue",
"parameters": {
"id": 311,
"confirm": true
}
}Worth knowing
- Repoint the events first.
events/update-eventcan move each one to the venue you are keeping. - A non-zero
linked_eventsmeans that many event pages now show no venue. - Restore from the trash in the admin if the count was a surprise — the links are still there, so restoring fixes them.
Related abilities
- List Events — count the affected events before you act
- Update Event — repoint events at the venue you are keeping
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category