snippets/deactivate-snippet switches a snippet off. The snippet and its code are kept.
No confirmation is required, because deactivating only ever reduces what runs.
At a glance
| Ability | snippets/deactivate-snippet |
| Toolset | WPCode — toolset/wpcode |
| Group | WPCode › Snippets |
| Requires | WPCode, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
The asymmetry is deliberate
Activating code needs a gate; stopping code does not. Every failure mode of this ability is “something stopped working”, which is recoverable in one call, while every failure mode of its opposite is “something started running”.
That makes this the right first move when a site is misbehaving and a snippet is the suspect. Switch it off, confirm the symptom goes, switch it back on if it does not — all without touching the code.
It is also the correct alternative to deletion almost every time. snippets/delete-snippet is permanent; this is not.
Idempotent, and the response confirms the snippet has left the loader cache.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
id | integer | Yes | Snippet ID. |
What comes back
| Name | Type | What it is |
|---|---|---|
snippet | object | The snippet after the write. |
in_cache | boolean | Whether WPCode’s loader cache holds the snippet. This, not the post status, is what decides whether it actually runs. |
safe_mode | boolean | Whether safe mode is active. When it is, no snippet runs regardless of everything else. |
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:
Turn off snippet 88 — I think it is breaking checkout.
It resolves to one call:
{
"ability": "snippets/deactivate-snippet",
"parameters": {
"id": 88
}
}Worth knowing
- Fully reversible with
snippets/activate-snippet. - Prefer this to deletion when diagnosing.
- The cache flag should come back false. If it does not, the cache is stale.
Related abilities
- Activate Code Snippet — switch it back on
- Delete Code Snippet — the permanent version
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category