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

Start free trial

List Code Snippets

snippets/list-snippets returns every WPCode snippet with its code type, whether it is active, where it is auto-inserted and at what priority.

Every row also reports whether the loader cache holds it. That is the field that answers “is this actually running”.

At a glance

Abilitysnippets/list-snippets
ToolsetWPCode — toolset/wpcode
GroupWPCode › Snippets
RequiresWPCode, active on the site
Capabilitymanage_options
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

WPCode does not read the snippets table on every request. It builds a loader cache and runs from that, which is why a snippet can be published in the database and still be completely inert — and why writing the snippet post type directly through the content or database abilities produces a row that looks right and does nothing.

So the listing reports both: the state stored against the snippet, and whether the loader cache currently holds it. When those disagree, the snippet is not doing what the admin screen says it is doing.

Safe mode is reported alongside. It suppresses every snippet at once, which makes it the first thing to rule out when nothing on a site is running — and it is invisible from a per-snippet view.

Filter by code type to separate the PHP that executes from the CSS that does not, or by active state to find what is switched off and why.

Input

NameTypeRequiredWhat it is
code_typestringNoOnly snippets of this type: php, js, css, html, text or universal.
activebooleanNoOnly active, or only inactive, snippets.
per_pageintegerNoMaximum rows to return.

What comes back

NameTypeWhat it is
snippetsarrayOne row per snippet: ID, title, code type, active state, location, priority, tags and whether the loader cache holds it.
countintegerHow many snippets were returned.
safe_modebooleanWhether safe mode is suppressing everything.
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:

What code snippets are running on this site?

It resolves to one call:

{
  "ability": "snippets/list-snippets",
  "parameters": {
    "active": true
  }
}

Worth knowing

  • An active snippet not in the cache is not running. That mismatch is the single most useful thing in the response.
  • Safe mode overrides everything else. Check it before investigating a single snippet.
  • PHP and universal snippets execute. The rest are inserted as markup.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading