Overview
wp-cli is a command line tool for managing WordPress. It is installed by default on WordPress Clouds, so you do not need to install it yourself. Once you connect over SSH, you can run it from the www directory.
Use wp-cli to:
- create and manage administrator users;
- install, activate and update plugins and themes;
- update WordPress core;
- run routine tasks without logging in to the WordPress admin.
Connect over SSH
Connect to a WordPress Cloud over SSH the same way you connect to any other Cloud. See Access Instances with SFTP & SSH and SSH & SFTP using SSH Keypairs.
Check that wp-cli works
After you connect, change to the WordPress web root and check wp-cli:
cd www wp --info wp core version
wp --info shows the wp-cli and PHP versions in use. wp core version shows the installed WordPress version.
Run wp-cli commands from the www directory. wp-cli looks for the WordPress installation in the directory where you run it.
Common tasks
Run these commands from the www directory.
Add an administrator
wp user create username user@example.com --role=administrator
wp-cli prints a generated password for the new user. To list users or set a new password:
wp user list wp user update username --user_pass="a-secure-password"
Install and update plugins
Check a plugin against the disallowed plugins list before you install it.
wp plugin list wp plugin install plugin-slug --activate wp plugin update --all
Update themes
wp theme list wp theme update --all
Update WordPress core
Create a backup first. Then run:
wp core check-update wp core update wp core update-db
For more on upgrades, see Upgrading WordPress.
Plugins and commands to avoid
- Disallowed plugins. Installing a plugin with wp-cli does not exempt it from the disallowed plugins list. The list includes backup plugins, because MODX Cloud already takes daily backups.
- Cloud Edge. Do not uninstall the Cloud Edge plugin before Cloud Edge is deprovisioned in the Dashboard. Avoid bulk commands such as
wp plugin uninstall --allorwp plugin delete --all.