Knowledge Base
MilesWeb / WordPress FAQ

Common Commands Used To Update WordPress Using WP-CLI

Approx. read time : 2 min

WP-CLI is a set of commands that can be used very easily. It allows you to run everything in wp-admin on a WordPress site but by using the command line. In order to run WP-CLI on Managed WordPress, you need to first obtain the SSH creds from the manager, with help of terminal or a command-line program like Putty. Then log in and change the home to HTML (where WordPress is installed). To work with WP-CLI you need to be present in this folder.

cd html

To update WordPress using WP-CLI

In order to update WordPress to the latest version, you need to run the following command.

Note:  You will have to replace the X value with the current version number or WordPress.

wp core update --version=5.0.x --force

For example, in order to update WordPress to the most current version which is 5.0.3, run the following command :

wp core update --version=5.0.3 --force

If you wish to update with the 5.1 version, then your command will be :

wp core update --version=5.1 --force

If any error occurs while running the wp core update command (like WordPress update is already in progress in the terminal), then a lock option value might be set. SO, you can delete that option value by using the following command :

wp option delete core_updater.lock

WordPress version using WP-CLI

Run following command, to verify the version of WordPress that is installed :

wp core version

Updating theme using WP-CLI

After updating WordPress, the next step is to update the default themes as well. By using the following command you can update those themes:

wp theme update twentysixteen twentyseventeen twentynineteen

In the above command, the themes updated would be Twenty Sixteen, Twenty Seventeen, and Twenty Nineteen.

Plugins updation using WP-CLI

If you have Akismet or Jetpack plugins installed, then you can update those two plugins by running either of the following commands :

wp plugin update akismet
wp plugin update jetpack

Alternatively, you can update both plugins using one following command :

wp plugin update akismet jetpack

Installing Classic Editor using WP-CLI

If your site was on an older version of WordPress (like 4.9.9) and you wish to update it to 5.0.3, but at the same time if you want to keep using the classic editor and not the new default Gutenberg block editor, then you can install and activate either the Classic Editor or Disable Gutenberg plugins.

Run the following command, to install and activate the Classic Editor plugin :

wp plugin install classic-editor --activate

Run following command, to install and activate the Disable Gutenberg plugin :

wp plugin install disable-gutenberg --activate

With the use of all these commands in WP-CLI it will become easy for you to update WordPress, themes, plugins, and also helps you to install plugins from the command line without having to update from wp-admin.

Also Read :

 Learn to stage a WordPress website using Softaculous in cPanel

 How To Fix RSS Feed Errors In WordPress?

 How to Create a Landing Page in WordPress?

With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.

Trusted By Thousands of Clients & Big Businesses

We highly appreciate the kind and stellar feedback we receive from our customers. Delivering the best is our goal! MilesWeb is rated Excellent out of 5 based on reviews. Read more reviews.

Excellent
Based on reviews
2 hours ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
4 hours ago
Milesweb is superb Hosting pro...
Milesweb is superb Hosting provider ever, their Support team is amazing!!!...
Abhishek Singh
15 hours ago
Great support in great timing...
We need urgent assistance on changes in a primary domain on our client's Cpanel accounts and reached...
Riyaju Deen
21 hours ago
Best Website Hosting platform ...
I was new on MilesWeb. And needed help on multiple areas from setting up to getting started with cre...
Harshada
1 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
1 days ago
the team is very supportive th...
the team is very supportive though at times effort needs to be made to make understand the problem s...
Suree Sharma
1 days ago
I am using miles web for 3plus...
I am using miles web for 3plus years, very quick and perfect support by the team, they helped me man...
Sri Raghav
2 days ago
The service is good...
The service is good. They are answering with patience and doing the needful as soon as possible....
MR
2 days ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
3 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
4 days ago
positively helped me with find...
positively helped me with finding insecure content on my website causing SSL to not work properly on...
Thaviraj Junglee
4 days ago
Exceptional support, Truly Pra...
I had opted for the basic wordpress hosting plan as I intended to experiment with various plug-ins. ...
Aseem Chandna