wp_cli_execute
Execute allowlisted WP-CLI commands to manage WordPress plugins, cache, posts, and themes while unsafe commands are blocked. Provide the command without the "wp" prefix.
Instructions
Execute a WP-CLI command. Deny by default: only allowlisted commands run (cache, comment, core, cron, language, media, menu, option, plugin, post, rewrite, role, sidebar, site, term, theme, transient, user, widget). db, eval, eval-file, shell, server, config and package are refused, as are the --require, --exec, --ssh, --http and --path flags. Quote any value containing shell metacharacters. The feature is off unless the site owner set WPAIA_ENABLE_WPCLI in wp-config.php — call wp_cli_status first. Do NOT include the "wp" prefix (e.g., "plugin list", "cache flush").
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "wp_cli_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The WP-CLI command to execute without the "wp" prefix (e.g., "plugin list", "cache flush", "rewrite flush") |