Run a WP-CLI command
run_wp_cliExecute only allowlisted WP-CLI commands via PHP emulation—no SSH or binary needed. Writes require admin; search-replace safely previews as a dry run first.
Instructions
Run a WP-CLI command against the site. Commands are emulated in PHP by the companion plugin — no WP-CLI binary or SSH access is needed on the host. Only allowlisted commands run (see list_cli_commands); everything else is refused. Writing commands need an Administrator account, and search-replace always previews as a dry run before it will touch anything.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format the command should produce where it supports one. | json |
| command | Yes | The command without the leading "wp", e.g. "plugin list --status=active" or "option get blogname". | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. | |
| confirm_token | No | Token from a previous dry-run preview, required for destructive commands such as search-replace. |