List Code Snippets is a WordPress ability from WPCode — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

List Code Snippets

Read-only
WPCode Content & Tools wpcode/list-snippets

Get a summary of every WPCode snippet, its status, and whether it's currently erroring.

Requires the WPCode (Insert Headers and Footers) plugin on WordPress 6.9+. All five abilities are read-only. 'list-snippets', 'detect-snippet-errors', and 'search-library' require the 'wpcode_edit_snippets' capability, while 'get-error-logs' and 'get-settings' require WordPress's 'manage_options' capability.

What it does

This ability returns a summary of all WPCode snippets stored as 'wpcode' posts, including publish and draft status. For each snippet it reports the ID, title, code type, insertion location, active/inactive state, tags, whether it currently has a logged error, and its last-modified date. Results can be filtered by status (all, active, or inactive), by code type (php, js, css, html, text, universal, blocks, or scss), or by tag. For security, the actual snippet code is deliberately excluded from the response — the plugin's source comments explicitly note the code field is withheld. This gives an AI assistant a fast inventory of what's installed on a site without granting it access to arbitrary code.

See it in action

You ask your AI assistant

"List all my active WPCode snippets and tell me which ones are PHP and which have errors."

Inputs

Name Type Required Description
status string No Filter by snippet status: 'all', 'active', or 'inactive'. Defaults to 'all'.
code_type string No Filter by code type: php, js, css, html, text, universal, blocks, or scss.
tag string No Filter snippets by a specific tag slug.

Returns

An array of snippet objects, each with id, title, code_type, location, active (boolean), tags, has_error (boolean), and last_update (date). The snippet's actual code is never included.

Permission

The current user must have the 'wpcode_edit_snippets' capability.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.