WP-CLI
$ wp Official High RiskWP-CLI (wp) is the standard command-line interface for administering WordPress sites—managing plugins, themes, users, cron jobs, config constants, and serialized database search-replace. Supports --format=json, --fields, --skip-plugins, --path, --url, and remote --ssh aliases.
brew install wp-cli wp runs directly inside the WordPress PHP runtime to execute PHP-serialized search-replace, plugin lifecycle hooks, and local DB operations that REST-based MCP servers cannot safely handle.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Strong --format=json, --fields, --skip-plugins, and --dry-run on search-replace, though plugin PHP notices can pollute stdout unless --skip-plugins is used.
--format=jsonand--fieldssupported across list/get subcommands--skip-pluginsisolates execution from noisy third-party PHP plugins
Includes --dry-run on search-replace and --yes gates on db reset/drop, though running arbitrary PHP/WordPress hooks carries high blast radius.
wp search-replace --dry-runpreviews serialized DB diffs safely
Distributed as a single PHAR or via brew install wp-cli, but requires a compatible PHP runtime and WordPress files/DB.
- Available via Homebrew and PHAR on macOS, Linux, and Windows
Unmatched breadth for WordPress admin, serialized DB replacement, cron, multisite, and remote --ssh management.
- Covers plugins, themes, users, config, cron, and DB in one CLI
Official WordPress project (wp-cli/wp-cli) licensed under MIT.
- Maintained under official WordPress org
Comprehensive command handbook at developer.wordpress.org/cli/commands/, though third-party plugins add custom subcommands with varying quality.
- Official WordPress CLI handbook and
--helpdocs
Security, Auth & Guardrails
Reads WordPress database credentials directly from wp-config.php in --path, and stores remote SSH site aliases in wp-cli.yml or ~/.wp-cli/config.yml using standard SSH key authentication.
MIT open-source CLI; free to use on any local or remote WordPress installation.
# WP-CLI (wp) Agent Rules - Always pass `--path <wp-root>` (or `@alias`) and `--format=json` on list/get commands. - Always run `wp search-replace ... --dry-run` before executing live database replacements. - Never run `wp db reset`, `wp db drop`, or `wp site delete` without explicit approval and a `wp db export` backup.
Agent-Ready Command Recipes
Safe Read-Only Queries
wp plugin list --format=json --skip-plugins
Outputs plugin names, statuses, and available updates as JSON while skipping plugin runtime loading.
wp search-replace 'http://old.example' 'https://new.example' --dry-run --skip-plugins
Counts matching database table changes across serialized PHP values without writing to the database.
Controlled Writes & Previews
wp plugin update akismet --format=json
Updates a named WordPress plugin and reports the update result as JSON.
Strengths for Agents
- + Widespread
--format=jsonand--fieldssupport across core WordPress resources. - +
--skip-pluginsprevents broken plugins from crashing or polluting agent JSON output.
Caveats & Pitfalls
- ! Requires PHP CLI and access to
wp-config.phpand the MySQL/MariaDB database. - ! Third-party plugins can emit PHP warnings to stdout unless
--skip-pluginsor--quietis used.