WP-CLI is a set of command-line tools for managing WordPress installations. The handy tool allows you to update plug-ins, configure multi-site installs without having to use a web browser so is particularly useful if you’re a WordPress developer or run a business built around the platform as the tool will help you do a lot more, in a lot less time.WordPress is an extremely popular blogging platform, used by an estimated 43% of websites. Although, built to be simple to use and edit, there are still benefits to being able to make changes via the command line, which is where WP-CLI comes in handy for many developers.
How does it work?
Once installed, the command tool can be used to everything you would want to perform within the WordPress admin plus a lot more that isn’t possible to do within the admin yet. For more info on getting started with WP-CLI or downloading it see HERE.
Updating all your core files in WordPress
Keeping WordPress up-to-date is one of the easiest things you can do to keep it secure. It’s increasingly easy, but you can do it with WP-CLI too.
It’s as simple as:
wp core update
Worried someone’s been tampering with your core files in the WordPress site or concerned you may have been hacked? Firstly, you can use the ‘checksums’ command below to find out straight away whether the WordPress core files on your site have been tampered with at all and if there are any unexpected files in the installation that could be suspect.
wp core verify – checksums
Then, by using the command below will revert WordPress core back to a known-good state;
wp core download –force
With this command, even if you don’t need an update, you’ll get your WordPress core files replaced with freshly downloaded ones from WordPress.org.
Of course, there are other ways to do this – you could download a zip file from WordPress.org, then extract it and upload the files but this simple command is MUCH faster. In fact, it’s probably quicker to do the whole WP-CLI install and run the command than to manually FTP the solution.
Why does it make a difference that WordPress owns it?
Now that the command tool is officially affiliated with WordPress the support and documentation is going to increase.
Since it’s acquisition of the open source tool in early 2017, the response from the WordPress community of developers has been overwhelmingly positive according to Bachhuber.