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

Start free trial

Deactivate Code Snippet

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

Abilitysnippets/deactivate-snippet
ToolsetWPCode — toolset/wpcode
GroupWPCode › Snippets
RequiresWPCode, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI 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

NameTypeRequiredWhat it is
idintegerYesSnippet ID.

What comes back

NameTypeWhat it is
snippetobjectThe snippet after the write.
in_cachebooleanWhether WPCode’s loader cache holds the snippet. This, not the post status, is what decides whether it actually runs.
safe_modebooleanWhether safe mode is active. When it is, no snippet runs regardless of everything else.
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:

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


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading