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
| Ability | snippets/list-snippets |
| Toolset | WPCode — toolset/wpcode |
| Group | WPCode › Snippets |
| Requires | WPCode, active on the site |
| Capability | manage_options |
| Safety | Read-only — changes nothing |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI 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
| Name | Type | Required | What it is |
|---|---|---|---|
code_type | string | No | Only snippets of this type: php, js, css, html, text or universal. |
active | boolean | No | Only active, or only inactive, snippets. |
per_page | integer | No | Maximum rows to return. |
What comes back
| Name | Type | What it is |
|---|---|---|
snippets | array | One row per snippet: ID, title, code type, active state, location, priority, tags and whether the loader cache holds it. |
count | integer | How many snippets were returned. |
safe_mode | boolean | Whether safe mode is suppressing everything. |
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:
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 Code Snippet — one snippet including its code and last error
- Get Snippet System Status — why nothing is running
- List Snippet Errors — what WPCode switched off for you
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category