WP-CLI: Using the command line to update your WordPress install

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.

  1. Make sure secure shell (SSH) is enabled for the cPanel account which contains the WP install you're modifying.
    1. Login to WHM, go to "Manage Shell Access" and enable Secure Shell for the account/s you want to access.
    2. Make sure you roll passwords (and make them sufficiently secure), and ideally use SSH key-pairs instead.
  2. Connect to the account via SSH. On macOS this is done via Terminal, and on Windows this can be done in PuTTY.
    1. We use the default SSH port for most instances. It should drop you in ~ (user homedir) upon login success.
  3. To update the WP core, plugins and themes, run the below commands in-order to make sure it finds your site.
    1. cd ~/public_html
    2. wp core update
    3. wp plugin update --all
    4. wp theme update --all
    5. wp maintenance-mode status

If you'd like more information about WP-CLI, see their website and the command reference below to keep learning.


Otherwise feel free to get in touch - it's always best to check before running commands, just in case!

  • 0 users found this helpful
Was this answer helpful?

Similar, and hopefully helpful

Website cloning: How to duplicate a WordPress website (cP)

If you're not using a system like WordPress Toolkit for staging, you can easily clone sites...