ZeroToWP

WP-CLI

Quick Definition

WP-CLI is the official command-line tool for managing WordPress. It lets you install plugins, update WordPress, manage the database, and perform bulk operations — all from the terminal without opening a browser.

WordPress.org — WP-CLI is the official command-line interface for WordPress

What Is WP-CLI?

WP-CLI (WordPress Command-Line Interface) is the official command-line tool for managing WordPress installations. According to wp-cli.org, it's "the command line interface for WordPress" — letting you do everything you'd do in the dashboard, but from a terminal window instead of a browser.

WP-CLI is maintained by the WordPress community (supported by Automattic, Bluehost, SiteGround, WP Engine, Cloudways, and others) and is currently at version 2.12.0. It requires PHP 5.6+ and WordPress 3.7+.

WP-CLI in Practice

Useful commands:

Core: wp core update, wp core version

Plugins: wp plugin install akismet --activate, wp plugin update --all, wp plugin deactivate broken-plugin

Themes: wp theme activate astra, wp theme update --all

Database: wp db export backup.sql, wp search-replace 'old.com' 'new.com', wp transient delete --all

Content: wp post list, wp user create admin admin@site.com --role=administrator

Most managed hosts (SiteGround, Kinsta, Cloudways) include WP-CLI pre-installed.

Why It Matters

Tasks that take minutes in the dashboard take seconds with WP-CLI. See our managed hosting guide and migration guide.

Related Terms

Related Articles