---
title: How to use WP-CLI
url: "https://pressable.com/knowledgebase/how-to-use-wp-cli/"
published: 2022-10-17
modified: 2024-12-19
author: Wayne McWilliams
---

WP-CLI comes preinstalled on Pressable and extends the shell to provide WordPress-specific command line tools. You can start running WP-CLI commands once you have [connected to SSH](https://pressable.com/knowledgebase/connect-to-ssh-on-pressable/).

There are many commands and subcommands that can help with managing and troubleshooting your site. For more on the commands available and how to use them, you can visit the [WordPress.org documentation for WP-CLI](https://developer.wordpress.org/cli/commands/)

## Manage Themes and Plugins with WP-CLI

WP-CLI can be used to manage and troubleshoot plugins and themes.

#### WP-CLI Command

`wp plugin list`

#### Description

List installed plugins including their status and version.

#### WP-CLI Command

`wp theme list`

#### Description

List installed themes.

#### WP-CLI Command

`wp plugin deactivate plugin-name`

#### Description

Deactivates a plugin. Replace `plugin-name` with a `name` value found via `wp plugin list`. Multiple plugin names can be entered in order to deactivate more than one.

#### WP-CLI Command

`wp plugin activate plugin-name`

#### Description

Activates a plugin. Replace `plugin-name` with a `name` value found via `wp plugin list`. Multiple plugin names can be entered in order to activate more than one.

#### WP-CLI Command

`wp theme activate theme-name`

#### Description

Activate a theme. Replace `theme-name` with a `name` value found via `wp theme list`.

#### WP-CLI Command

`wp php-errors`

#### Description

List recent PHP errors logged. This is useful for identifying problematic plugins and themes that may need to be updated or deactivated.

## Skip Themes and Plugins with WP-CLI

If your site is encountering errors and cannot run commands, it may be necessary to skip the site’s active theme and plugin code. This is done by adding `--skip-themes` and `--skip-plugins` to any WP-CLI command.

#### WP-CLI Command

`wp --skip-plugins --skip-themes plugin deactivate plugin-name`

#### Description

Skip theme and plugin code then deactivate a plugin. Replace `plugin-name` with a `name` value found via `wp plugin list`.

#### WP-CLI Command

`wp --skip-plugins --skip-themes theme activate theme-name`

#### Description

Skip theme and plugin code then activate a theme. Replace `theme-name` with a `name` value found via `wp theme list`.

#### WP-CLI Command

`wp --skip-plugins --skip-themes php-errors`

#### Description

Skip theme and plugin code then list recent PHP errors logged. This is useful for identifying problematic plugins and themes that may need to be updated or deactivated.

 
 Please Note: Pressable’s WP-CLI implementation has a strict order for commands and parameters, especially global parameters.

For example, if you encounter an error similar to
`unknown --url parameter`
for a command like
`wp option get siteurl --url=<example>`
you must move the `--url` parameter to be right after `wp` and before the command as below
`wp --url='<example>' option get siteurl`

## Additional WP-CLI Resources

- [WordPress.org’s WP-CLI documentation](https://developer.wordpress.org/cli/commands/)
- [WooCommerce’s WP-CLI documentation](https://github.com/woocommerce/woocommerce/wiki/WC-CLI-Overview)
- [Jetpack’s CLI documentation](https://jetpack.com/support/jetpack-cli/)
- [WP-CLI.org](https://wp-cli.org/)

## Run WP-CLI Commands Across Multiple Sites

You can run WP-CLI commands across multiple Pressable sites by using our [Bulk Operations feature](https://pressable.com/knowledgebase/run-bulk-operations-on-your-pressable-sites).

## API Usage

Pressable allows customers to [run WP-CLI commands via the API](https://my.pressable.com/documentation/api/v1#wp-cli-commands).

We prefix all commands with our appropriate WP-CLI path, so do not include it in your request. For example: if you wish to run the command `wp role create employee Employee`, the command array should look like this: `[ 'role create employee Employee' ]`

To stay informed when your commands are completed, we recommend integrating with our [webhooks](https://my.pressable.com/documentation/api/v1#webhooks). Responses from the WP-CLI command are directly relayed back via [these webhooks](https://my.pressable.com/documentation/api/v1#site-ssh-command).

 
 Please Note:  Our system processes commands using job queues. If a command fails, the MyPressable Control Panel will ***not*** retry the failed command.

## Frequently Asked Questions

#### Can I get support for using command line tools?

Due to the complex nature of SSH and WP-CLI, we are not able to provide extensive support for using these tools. Our Support Team is available to help with issues connecting via SSH but cannot guide you through using commands.

#### Are all commands available?

In order to provide a secure and performant environment, Pressable may restrict or disable certain shell and WP-CLI commands.

#### What if something goes wrong?

If something happens to your site after you’ve made changes via SSH, or if you run a command and something happens you didn’t expect, you can [restore your site from a backup](https://pressable.com/knowledgebase/how-to-restore-site-from-backup/).
We will **NOT** be able to help you debug your command to make it work as expected.
