wp plugin

Manages plugins, including installs, activations, and updates.

See the WordPress Plugin Handbook developer resource for more information on plugins.

Subcommands

CommandDescription
wp plugin activateActivates one or more plugins.
wp plugin auto-updatesManages plugin auto-updates.
wp plugin deactivateDeactivates one or more plugins.
wp plugin deleteDeletes plugin files without deactivating or uninstalling.
wp plugin getGets details about an installed plugin.
wp plugin installInstalls one or more plugins.
wp plugin is-activeChecks if a given plugin is active.
wp plugin is-installedChecks if a given plugin is installed.
wp plugin listGets a list of plugins.
wp plugin pathGets the path to a plugin or to the plugin directory.
wp plugin searchSearches the WordPress.org plugin directory.
wp plugin statusReveals the status of one or all plugins.
wp plugin toggleToggles a plugin’s activation state.
wp plugin uninstallUninstalls one or more plugins.
wp plugin updateUpdates one or more plugins.
wp plugin verify-checksumsVerifies plugin files against WordPress.org’s checksums.

wp plugin activate

Activates one or more plugins.

Synopsis

bash
wp plugin activate [<plugin>...] [--all] [--exclude=<name>] [--network]

Options

[<plugin>...] : One or more plugins to activate.

[--all] : If set, all plugins will be activated.

[--exclude=<name>] : Comma separated list of plugin slugs to be excluded from activation.

[--network] : If set, the plugin will be activated for the entire multisite network.

Examples

bash
# Activate plugin
$ wp plugin activate hello
Plugin 'hello' activated.
Success: Activated 1 of 1 plugins.

# Activate plugin in entire multisite network
$ wp plugin activate hello --network
Plugin 'hello' network activated.
Success: Network activated 1 of 1 plugins.

wp plugin auto-updates

Manages plugin auto-updates.

Subcommands

CommandDescription
wp plugin auto-updates disableDisables the auto-updates for a plugin.
wp plugin auto-updates enableEnables the auto-updates for a plugin.
wp plugin auto-updates statusShows the status of auto-updates for a plugin.

Examples

bash
# Enable the auto-updates for a plugin
$ wp plugin auto-updates enable hello
Plugin auto-updates for 'hello' enabled.
Success: Enabled 1 of 1 plugin auto-updates.

# Disable the auto-updates for a plugin
$ wp plugin auto-updates disable hello
Plugin auto-updates for 'hello' disabled.
Success: Disabled 1 of 1 plugin auto-updates.

# Get the status of plugin auto-updates
$ wp plugin auto-updates status hello
Auto-updates for plugin 'hello' are disabled.

wp plugin deactivate

Deactivates one or more plugins.

Synopsis

bash
wp plugin deactivate [<plugin>...] [--uninstall] [--all] [--exclude=<name>] [--network]

Options

[<plugin>...] : One or more plugins to deactivate.

[--uninstall] : Uninstall the plugin after deactivation.

[--all] : If set, all plugins will be deactivated.

[--exclude=<name>] : Comma separated list of plugin slugs that should be excluded from deactivation.

[--network] : If set, the plugin will be deactivated for the entire multisite network.

Examples

bash
# Deactivate plugin
$ wp plugin deactivate hello
Plugin 'hello' deactivated.
Success: Deactivated 1 of 1 plugins.

# Deactivate all plugins with exclusion
$ wp plugin deactivate --all --exclude=hello,wordpress-seo
Plugin 'contact-form-7' deactivated.
Plugin 'ninja-forms' deactivated.
Success: Deactivated 2 of 2 plugins.

wp plugin delete

Deletes plugin files without deactivating or uninstalling.

Synopsis

bash
wp plugin delete [<plugin>...] [--all] [--exclude=<name>]

Options

[<plugin>...] : One or more plugins to delete.

[--all] : If set, all plugins will be deleted.

[--exclude=<name>] : Comma separated list of plugin slugs to be excluded from deletion.

Examples

bash
# Delete plugin
$ wp plugin delete hello
Deleted 'hello' plugin.
Success: Deleted 1 of 1 plugins.

# Delete inactive plugins
$ wp plugin delete $(wp plugin list --status=inactive --field=name)
Deleted 'tinymce-templates' plugin.
Success: Deleted 1 of 1 plugins.

wp plugin get

Gets details about an installed plugin.

Synopsis

bash
wp plugin get <plugin> [--field=<field>] [--fields=<fields>] [--format=<format>]

Options

<plugin> : The plugin to get.

[--field=<field>] : Instead of returning the whole plugin, returns the value of a single field.

[--fields=<fields>] : Limit the output to specific fields. Defaults to all fields.

[--format=<format>] : Render output in a particular format (table, csv, json, yaml).

Available Fields

Default: name, title, author, version, description, status

Optional: requires_wp, requires_php, requires_plugins

Examples

bash
$ wp plugin get bbpress --format=json
{"name":"bbpress","title":"bbPress","author":"The bbPress Contributors","version":"2.6.9","description":"bbPress is forum software with a twist from the creators of WordPress.","status":"active"}

wp plugin install

Installs one or more plugins.

Synopsis

bash
wp plugin install <plugin|zip|url>... [--version=<version>] [--force] [--ignore-requirements] [--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>] : If set, get that particular version from wordpress.org, instead of the stable version.

[--force] : If set, the command will overwrite any installed version of the plugin, without prompting for confirmation.

[--ignore-requirements] : If set, the command will install the plugin while ignoring any WordPress or PHP version requirements.

[--activate] : If set, the plugin will be activated immediately after install.

[--activate-network] : If set, the plugin will be network activated immediately after install.

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

Examples

bash
# Install the latest version from wordpress.org and activate
$ wp plugin install bbpress --activate
Installing bbPress (2.5.9)
Downloading install package from https://downloads.wordpress.org/plugin/bbpress.2.5.9.zip...
Plugin installed successfully.
Activating 'bbpress'...
Plugin 'bbpress' activated.
Success: Installed 1 of 1 plugins.

# Install the development version from wordpress.org
$ wp plugin install bbpress --version=dev
Installing bbPress (Development Version)
Success: Installed 1 of 1 plugins.

# Install from a local zip file
$ wp plugin install ../my-plugin.zip
Success: Installed 1 of 1 plugins.

wp plugin is-active

Checks if a given plugin is active. Returns exit code 0 when active, 1 when not active.

Synopsis

bash
wp plugin is-active <plugin> [--network]

Examples

bash
$ wp plugin is-active hello
$ echo $?
1

wp plugin is-installed

Checks if a given plugin is installed. Returns exit code 0 when installed, 1 when uninstalled.

Synopsis

bash
wp plugin is-installed <plugin>

Examples

bash
$ wp plugin is-installed hello
$ echo $?
1

wp plugin list

Gets a list of plugins.

Synopsis

bash
wp plugin list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>] [--status=<status>] [--skip-update-check] [--recently-active]

Options

[--<field>=<value>] : Filter results based on the value of a field.

[--field=<field>] : Prints the value of a single field for each plugin.

[--fields=<fields>] : Limit the output to specific object fields.

[--format=<format>] : Render output in a particular format (table, csv, count, json, yaml).

[--status=<status>] : Filter the output by plugin status (active, active-network, dropin, inactive, must-use).

[--skip-update-check] : If set, the plugin update check will be skipped.

[--recently-active] : If set, only recently active plugins will be shown.

Available Fields

Default: name, status, update, version, update_version, auto_update

Optional: update_package, update_id, title, description, file, author, tested_up_to, requires, requires_php, wporg_status, wporg_last_updated

Examples

bash
# List active plugins on the site.
$ wp plugin list --status=active --format=json
[{"name":"dynamic-hostname","status":"active","update":"none","version":"0.4.2"}]

# Check whether plugins are still active on WordPress.org
$ wp plugin list --fields=name,wporg_status,wporg_last_updated

wp plugin path

Gets the path to a plugin or to the plugin directory.

Synopsis

bash
wp plugin path [<plugin>] [--dir]

Examples

bash
$ cd $(wp plugin path) && pwd
/var/www/wordpress/wp-content/plugins

Searches the WordPress.org plugin directory.

Synopsis

bash
wp plugin search <search> [--page=<page>] [--per-page=<per-page>] [--field=<field>] [--fields=<fields>] [--format=<format>]

Examples

bash
$ wp plugin search dsgnwrks --per-page=20 --format=json
Success: Showing 3 of 3 plugins.

$ wp plugin search dsgnwrks --fields=name,version,slug,rating,num_ratings

wp plugin status

Reveals the status of one or all plugins.

Synopsis

bash
wp plugin status [<plugin>]

Examples

bash
$ wp plugin status
5 installed plugins:
  I akismet                3.1.11
  I easy-digital-downloads 2.5.16
  A theme-check            20160523.1
  I wen-logo-slider        2.0.3
  M ns-pack                1.0.0
Legend: I = Inactive, A = Active, M = Must Use

wp plugin toggle

Toggles a plugin’s activation state.

Synopsis

bash
wp plugin toggle <plugin>... [--network]

Examples

bash
# Akismet is currently activated
$ wp plugin toggle akismet
Plugin 'akismet' deactivated.
Success: Toggled 1 of 1 plugins.

wp plugin uninstall

Uninstalls one or more plugins.

Synopsis

bash
wp plugin uninstall [<plugin>...] [--deactivate] [--skip-delete] [--all] [--exclude=<name>]

Options

[<plugin>...] : One or more plugins to uninstall.

[--deactivate] : Deactivate the plugin before uninstalling. Default behavior is to warn and skip if the plugin is active.

[--skip-delete] : If set, the plugin files will not be deleted. Only the uninstall procedure will be run.

[--all] : If set, all plugins will be uninstalled.

[--exclude=<name>] : Comma separated list of plugin slugs to be excluded from uninstall.

Examples

bash
$ wp plugin uninstall hello
Uninstalled and deleted 'hello' plugin.
Success: Uninstalled 1 of 1 plugins.

wp plugin update

Updates one or more plugins.

Synopsis

bash
wp plugin update [<plugin>...] [--all] [--exclude=<name>] [--minor] [--patch] [--format=<format>] [--version=<version>] [--dry-run] [--insecure]

Options

[<plugin>...] : One or more plugins to update.

[--all] : If set, all plugins that have updates will be updated.

[--exclude=<name>] : Comma separated list of plugin names that should be excluded from updating.

[--minor] : Only perform updates for minor releases (e.g. from 1.3 to 1.4 instead of 2.0).

[--patch] : Only perform updates for patch releases (e.g. from 1.3 to 1.3.3 instead of 1.4).

[--format=<format>] : Render output in a particular format (table, csv, json, summary).

[--version=<version>] : If set, the plugin will be updated to the specified version.

[--dry-run] : Preview which plugins would be updated.

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

Examples

bash
$ wp plugin update bbpress --version=dev
Success: Updated 1 of 2 plugins.

$ wp plugin update --all
Success: Updated 2 of 2 plugins.

wp plugin verify-checksums

Verifies plugin files against WordPress.org’s checksums.

Synopsis

bash
wp plugin verify-checksums [<plugin>...] [--all] [--strict] [--version=<version>] [--format=<format>] [--insecure] [--exclude=<name>]

Options

[<plugin>...] : One or more plugins to verify.

[--all] : If set, all plugins will be verified.

[--strict] : If set, even "soft changes" like readme.txt changes will trigger checksum errors.

[--version=<version>] : Verify checksums against a specific plugin version.

[--format=<format>] : Render output in a specific format (table, json, csv, yaml, count).

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

[--exclude=<name>] : Comma separated list of plugin names that should be excluded from verifying.

Examples

bash
# Verify the checksums of all installed plugins
$ wp plugin verify-checksums --all
Success: Verified 8 of 8 plugins.

# Verify the checksums of a single plugin
$ wp plugin verify-checksums akismet
Success: Verified 1 of 1 plugins.