LinuxCommandLibrary

wp

WordPress command-line management tool

TLDR

Show WordPress info

$ wp --info
copy
Update WordPress core
$ wp core update
copy
Install plugin
$ wp plugin install [plugin-name]
copy
Activate plugin
$ wp plugin activate [plugin-name]
copy
Install theme
$ wp theme install [theme-name]
copy
Create user
$ wp user create [username] [email@example.com] --role=[editor]
copy
Search/replace in database
$ wp search-replace [old-url] [new-url]
copy
Export database
$ wp db export [backup.sql]
copy

SYNOPSIS

wp command [subcommand] [options]

DESCRIPTION

wp (WP-CLI) is the official command-line interface for WordPress administration. It provides complete control over WordPress installations from the terminal, including core updates, plugin and theme management, user administration, and database operations.
Common workflows include installing and activating plugins, creating users with specific roles, exporting and importing databases, and performing search-replace operations across the database for tasks like domain migration. The tool can also manage posts, pages, comments, and virtually every aspect of a WordPress site without needing a web browser.

PARAMETERS

core - WordPress core
plugin - Plugin management
theme - Theme management
user - User management
db - Database operations
cache - Cache commands
config - Configuration
--path DIR

WordPress path.
--url URL
Site URL.
--skip-plugins
Skip loading plugins.

CAVEATS

Requires WordPress installation. PHP needed. Some operations need database access.

HISTORY

WP-CLI was created for WordPress command-line management. It's the official CLI tool for WordPress administration.

SEE ALSO

php(1), mysql(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community