What are Common Commands to Update WordPress Using WP-CLI?

Cpanel/Whm License $3/mo Plesk License $10/mo Cloudlinux License $5/mo

WP-CLI is a very handy set of commands. You can run anything that you would run in wp-admin on a WordPress site but from the command line. Useful commands which WP-CLI employs to keep WordPress core updated plugins including the default themes which come with WordPress.

To run WP-CLI on Managed WordPress or Managed WooCommerce, you would need to obtain the SSH creds from the manager, by using the terminal or a command line program like Putty. You’ll then log in and change the home to HTML (which is where WordPress is installed). You have to be in this folder for WP-CLI to work.

cd html

 

Updating WordPress using WP-CLI

To update WordPress to the most current version, you can run this command, where you would replace out the X  value with the current version number or WordPress.

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

To update WordPress to the most current version which is 5.0.3, run this command:

wp core update --version=5.0.3 --force

When WordPress 5.1 is released in February 2019, the command will be:

wp core update --version=5.1 --force

If an error does show whilst running the wp core update command (e.g., a WordPress update is already in progress in the terminal), a lock option value might be set. You can delete that option value by using this command:

wp option delete core_updater.lock

 

Version of WordPress using WP-CLI

To verify the version of WordPress that is installed, you can run this command:

wp core version

 

Updating Themes Using WP-CLI

Once you have updated WordPress, that will mean the default themes need to be updated as well. You can update those themes by using this command:

wp theme update twentysixteen twentyseventeen twentynineteen

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

 

Updating Plugins Using WP-CLI

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

wp plugin update akismet

wp plugin update jetpack

You can alternatively update both plugins from one command using:

wp plugin update akismet jetpack

 

Install Classic Editor using WP-CLI

If the site was on an older version of WordPress (such as 4.9.9) and you were updating to 5.0.3, but you wanted to keep using the classic editor and not the new default Gutenberg block editor, you can install and activate either the Classic Editor or Disable Gutenberg plugins.

To install and activate the Classic Editor plugin, you can run this command:

wp plugin install classic-editor --activate

To install and activate the Disable Gutenberg plugin, use:

wp plugin install disable-gutenberg --activate

Using these commands in WP-CLI will make it easier to update WordPress, themes, plugins, and help you to install plugins from the command line without having to update from wp-admin. Managed WordPress and Managed WooCommerce will automatically update WordPress core, plugins and themes which are on WordPress.org.

 

Related posts

Ethereum Software Parity to Update After Critical Bug Detected

SXI ADMIN

Beyond New York: What Lies Ahead for Bitcoin

SXI ADMIN

BTC-e Is Back Online, But Refund Efforts Are Anything But Smooth

SXI ADMIN

Install Atom Text Editor on RHEL 8 / CentOS 8

SXI ADMIN

Blockchain Startup ArabianChain Nets $817k from New Investor

SXI ADMIN

How BlockScore is Making Bitcoin Regulatory Compliance Absurdly Simple

SXI ADMIN

Linux / Unix: Find Hidden Directories, Files and Folders

SXI ADMIN

Bigger Blocks and Smarter Contracts: What’s In Bitcoin Cash’s Next Fork?

SXI ADMIN

Linux / Unix curl: Pass HTTP Referer

SXI ADMIN

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More