WP-CLI

WP-CLI (WordPress Command Line Interface) is a powerful tool that allows you to manage your WordPress site using the command line or terminal, instead of the admin dashboard. It’s especially useful for developers, sysadmins, and anyone managing multiple or large-scale WordPress sites.

What Can You Do with WP-CLI?

With WP-CLI, you can perform almost any administrative or development task – faster and more efficiently – without logging into the WordPress dashboard.

TaskCommand Example
Check WordPress versionwp core version
Install a pluginwp plugin install akismet
Update all pluginswp plugin update --all
Create a new postwp post create --post_title="Hello World"
Export databasewp db export
Search and replace in the DBwp search-replace 'oldurl.com' 'newurl.com'
Clear cache (for supported plugins)wp cache flush

Installing WP-CLI

  1. Make sure your server supports PHP 5.6+ and UNIX-like OS (Linux, macOS).
  2. Download the Phar file: bashCopyEditcurl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
  3. Make it executable: bashCopyEditchmod +x wp-cli.phar sudo mv wp-cli.phar /usr/local/bin/wp
  4. Test: bashCopyEditwp --info

Advantages of WP-CLI

  • Faster workflows — especially for batch operations
  • Automation-ready — ideal for scripts, CI/CD, deployment pipelines
  • Remote management — when combined with SSH or WP REST API
  • Plugin and theme scaffolding — easily create boilerplates