Posted in: WORDPRESS

How to manage WordPress updates with WP-ClI

WP-CLI makes our life easier in more ways than one. Indeed, thanks to this, you are able to manage your website without going through your WordPress Dashboard. This allows you to save time in managing your site. In addition to managing posts, pages or comments, WP-Cli also allows you to manage updates to your WordPress site.

In this article, i’ll explain how to use this tool to maintain your WordPress site, i.e. plugins and themes.

How to install WP-ClI?

The first thing to do is install WP-ClI. To do this, connect to your web hosting control panel also known as cPanel interface, click on “Terminal” in the advanced section. Then run the following command:

curl -c http://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

You can then check the functioning of WP-Cli using the following command:

php wp-cli.phar --info

Finally, it is necessary to make the file executable by moving it to a suitable location and renaming it:

chmod + x wp-cli.phar
sudo mv wp-cli.phar / usr / local / bin / wp

 

How to update WP-Cli?

WP-ClI can manage its own updates itself. In fact, you can view updates to the latter using the check-update option, as follows:

wp cli check-update

You can then update wp-cli with the following command:

sudo / usr / local / bin / wp cli update

How to update WordPress with WP-ClI?

WP-ClI allows checking and updating WordPress from a command line. Indeed, you have the possibility to verify that an update exists by using the following command:

wp core check-update

If an update is available, you can install it with the following command:

wp core update

As with WordPress, you can update your plugins. First, you can view the list of extensions. When viewing the latter, you will see the version used by plugins and whether an update is available or not. The command to use is as follows:

wp plugin list

If several plugins are to be updated, you can perform this action with the following command:

wp plugin update –all

We proceed in the same way to update the themes. First, it is necessary to check the status of the themes installed by running the following command:

wp theme status

You can request the update of your themes with the following command:

wp theme update --all

 

Conclusion

You have the option to update your WordPress site, plugins and themes through your WordPress Dashboard. However, if you have cPanel or VPS hosting, it may be easier and faster to perform the various updates through your SSH access. Indeed, thanks to the WP-Cli tool, you will be able to update WordPress, themes or plugins installed by you.

Leave a Reply

Your email address will not be published.