Table of Content

WP CLI Introduction WP CLI Introduction

If you are a fan of using a terminal or the command prompts then you love the WP CLI (WordPress Command Line Interface) commands.

We can do all the things like creating the user, updating plugins, installing theme etc with WP CLI commands.

If you have not yet installed the WP CLI on your system then read the article How to install WP CLI?

If you have installed the WP CLI on your system then you may need the list of all the WP CLI commands. Check the WP CLI cheat sheet for reference.

We have the wp core update command which updates the core WordPressWordPress WordPress (WordPress.org) is a content management system (CMS) based on PHP and MySQL that is usually used with the MySQL or MariaDB database servers but can also use the SQLite database engine. from the command line.

If we use the WP CLI command wp core update then it updates WordPress to a newer version.

Some times we get an error “Error: Another update is currently in progress.” because another update is in process. To avoid this error just execute the command:

wp option delete core_updater.lock

It removes the update lock and processes the update.

WP CORE command WP CORE command

In WordPress, we have the core commands in which we can do the Downloads, installs, updates, and manages a WordPress installation.

We can see the wp core command help with command:

wp core help

Options Options

  • [<zip>] => Path to zip file to use, instead of downloading from wordpress.org.
  • [–minor] => Only perform updates for minor releases (e.g. update from WP 4.3 to 4.3.3 instead of 4.4.2).
  • [–version=<version>] => Update to a specific version, instead of to the latest version. Alternatively accepts ‘nightly’.
  • [–force] => Update even when installed WP version is greater than the requested version.
  • [–locale=<locale>] => Select which language you want to download.

How to use it? How to use it?

How to update WordPress with the latest version? How to update WordPress with the latest version?

$ wp core update
Updating to version 4.5.2 (en_US)...
Downloading update from https://downloads.wordpress.org/release/wordpress-4.5.2-no-content.zip...
Unpacking the update...
Cleaning up files...
No files found that need cleaning up
Success: WordPress updated successfully.

Update WordPress to the latest version of 3.8 release? Update WordPress to the latest version of 3.8 release?

$ wp core update --version=3.8 ../latest.zip
Updating to version 3.8 ()...
Unpacking the update...
Cleaning up files...
File removed: wp-admin/js/tags-box.js
...
File removed: wp-admin/js/updates.min.
377 files cleaned up
Success: WordPress updated successfully.

How to update WordPress to 3.1 forcefully? How to update WordPress to 3.1 forcefully?

$ wp core update --version=3.1 --force
Updating to version 3.1 (en_US)...
Downloading update from https://wordpress.org/wordpress-3.1.zip...
Unpacking the update...
Warning: Checksums not available for WordPress 3.1/en_US. Please cleanup files manually.
Success: WordPress updated successfully.

Leave a Reply

Your email address will not be published. Required fields are marked *