Skip to main content

wp help

Overview

Get detailed documentation for any WP-CLI command or subcommand directly in your terminal — no browser needed. wp help shows the full syntax, all available flags, usage examples, and related subcommands for whatever you pass it.

What It Does

wp help is WP-CLI's built-in man page system. It reads the docblock of each registered command and formats it for terminal display. Unlike --help (which gives a compact summary), wp help provides the full, paginated documentation.

Syntax

wp help [<command>] [<subcommand>]

Basic Examples

Get help for WP-CLI itself

wp help

Output:

NAME

wp

DESCRIPTION

Manage WordPress through the command-line.

SYNOPSIS

wp <command>

SUBCOMMANDS

cache Adds, removes, fetches, and flushes the WP Object Cache object.
cap Adds, removes, and lists capabilities of a user role.
cli Reviews current WP-CLI info, checks for updates, etc.
comment Creates, updates, deletes, and moderates comments.
config Generates and reads the wp-config.php file.
core Downloads, installs, updates, and manages a WordPress install.
...

Help for a top-level command

wp help plugin

Output:

NAME

wp plugin

DESCRIPTION

Manages plugins, including installs, activations, and updates.

SYNOPSIS

wp plugin <command>

SUBCOMMANDS

activate Activates one or more plugins.
deactivate Deactivates one or more plugins.
delete Deletes plugin files without deactivating or unregistering them.
get Gets details about an installed plugin.
install Installs one or more plugins.
is-installed Checks if a given plugin is installed.
list Gets a list of plugins.
path Gets the path to a plugin or to the plugin directory.
search Searches the WordPress.org plugin directory.
status Reveals the status of one or more plugins.
toggle Toggles a plugin's activation state.
uninstall Uninstalls one or more plugins.
update Updates one or more plugins.
verify-checksums Verifies plugin files against WordPress.org's checksums.

Help for a specific subcommand

wp help plugin install

Output:

NAME

wp plugin install

DESCRIPTION

Installs one or more plugins.

SYNOPSIS

wp plugin install <plugin|zip|url>... [--version=<version>]
[--force] [--activate] [--activate-network] [--insecure]

OPTIONS

<plugin|zip|url>...
One or more plugins to install. Accepts a plugin slug, the path to a
local zip file, or a URL to a remote zip file.

[--version=<version>]
Get that particular release from wordpress.org, instead of the
stable version.

[--force]
Re-install the plugin even if it's already installed.

[--activate]
Activate the plugin after installation.

[--activate-network]
Network-activate the plugin.

[--insecure]
Retry downloads without certificate validation if TLS handshake fails.

EXAMPLES

# Install the latest version from wordpress.org and activate
$ wp plugin install bbpress --activate

# Install the development version of the plugin
$ wp plugin install bbpress --version=dev

# Install from a local zip file
$ wp plugin install ../my-plugin.zip

Help for database commands

wp help db

Output:

NAME

wp db

DESCRIPTION

Performs basic database operations using credentials stored in wp-config.php.

SUBCOMMANDS

check Checks the current status of the database.
clean Removes all tables with a given prefix.
cli Opens a MySQL console using credentials from wp-config.php.
columns Displays information about a given table.
create Creates a new database.
drop Deletes the existing database.
export Exports the database to a file or to STDOUT.
import Imports a database from a file or from STDIN.
optimize Optimizes the database.
prefix Displays the database table prefix.
query Executes a SQL query against the database.
repair Repairs the database.
reset Removes all tables from the database.
search Finds a string in the database.
size Displays the database name and size.
tables Lists the database tables.

Help for cache commands

wp help cache

Output:

NAME

wp cache

DESCRIPTION

Adds, removes, fetches, and flushes the WP Object Cache object.

SUBCOMMANDS

add Adds a value to the object cache.
delete Removes a value from the object cache.
flush Flushes the object cache.
get Gets a value from the object cache.
set Sets the value of a cached object.
type Attempts to determine which object cache is being used.

Help for the wp eval command itself

wp help eval

Output:

NAME

wp eval

DESCRIPTION

Executes arbitrary PHP code.

SYNOPSIS

wp eval <php-code> [--skip-wordpress]

OPTIONS

<php-code>
The code to execute, as a string.

[--skip-wordpress]
Execute code without loading WordPress.

EXAMPLES

# Display WordPress content types.
$ wp eval 'echo wp_list_pluck( get_post_types(), 'label' );'

# Pass an arbitrary string to a script.
$ wp eval 'print html_entity_decode( "H1Hello worldH1" );'

When to Use --help vs wp help

Both provide documentation, but with different lengths:

Flag/CommandOutput StyleDetail Level
wp COMMAND --helpCompact, inlineSummary only
wp help COMMANDPaginated, full man pageFull examples and options

Example comparison

wp plugin install --help

Output:

usage: wp plugin install <plugin|zip|url>... [--version=<version>] [--force] [--activate] ...
wp help plugin install

Output: (The full paginated man page as shown above)

When the output is long, WP-CLI uses a pager (usually less):

KeyAction
SpacePage forward
bPage back
qQuit
/keywordSearch forward
nJump to next search match

Discovering Subcommands You Didn't Know About

A great use of wp help is discovering subcommands of a group:

wp help user
SUBCOMMANDS

add-cap Adds capabilities to a user.
add-role Adds a role for a user.
create Creates a new user.
delete Deletes one or more users from the current site.
generate Generates some users.
get Gets details about a user.
import-csv Imports users from a CSV file.
list Lists users.
list-caps Lists all capabilities for a user.
meta Manages user custom fields.
remove-cap Removes capabilities from a user.
remove-role Removes a user's role.
reset-password Resets the password for one or more users.
set-role Sets the user role.
spam Marks one or more users as spam.
term Manages user terms.
unspam Removes one or more users from spam.
update Updates an existing user.

Quick Reference

wp help                          # WP-CLI root help
wp help plugin # Plugin group subcommands
wp help plugin install # Specific subcommand detail
wp help cache # Cache subcommands
wp help db # Database group
wp help eval # Eval command help
wp help eval-file # Eval-file command help
wp help shell # Shell REPL help

Next Steps