If you're managing a range of sites, or even a single busy website, WP-CLI can save you valuable time managing them.
WP-CLI is available on all Merlot Digital Servers, so you're able to jump straight in and make the most of WordPress!
Here's a quick run-through of how to perform some key tasks, to get you going with WP via command-line-interface.
- Make sure secure shell (SSH) is enabled for the cPanel account which contains the WP install you're modifying.
- Login to WHM, go to "Manage Shell Access" and enable Secure Shell for the account/s you want to access.
- Make sure you roll passwords (and make them sufficiently secure), and ideally use SSH key-pairs instead.
- Connect to the account via SSH. On macOS this is done via Terminal, and on Windows this can be done in PuTTY.
- We use the default SSH port for most instances. It should drop you in ~ (user homedir) upon login success.
- To update the WP core, plugins and themes, run the below commands in-order to make sure it finds your site.
-
cd ~/public_html
-
wp core update
-
wp plugin update --all
-
wp theme update --all
-
wp maintenance-mode status
-
If you'd like more information about WP-CLI, see their website and the command reference below to keep learning.
- WP-CLI website: https://wp-cli.org/
- Handbook: https://make.wordpress.org/cli/handbook/
- Command reference: https://developer.wordpress.org/cli/commands/
Otherwise feel free to get in touch - it's always best to check before running commands, just in case!