WP-CLI can help you manage your website built on WordPress, directly from the command line. You can use the wp core command to download, install, delete and update WordPress.
To check for available updates and update WordPress from the command line using WP-CLI we recommend that you follow the steps described below.
Checking for available updates
- Log in to the server via SSH with the cPanel user who owns the website for which you want to make updates.
- Use the cd command to access the root folder of your website eg:
cd public_html/my_website
Replace public_html/my_website with the actual path to the root folder of your website.
- Run the following command to check for updates available for WordPress:
wp core check-update
The above command will return two response options:
1. will indicate the available updates, as in this example:
+---------+-------------+---------------------------------------------------------------+ | version | update_type | package_url | +---------+-------------+---------------------------------------------------------------+ | #.#.# | minor | https://downloads.wordpress.org/release/wordpress-#.#.#.zip | | #.#.# | major | https://downloads.wordpress.org/release/wordpress-#.#.#.zip | +---------+-------------+---------------------------------------------------------------+
2. will indicate that no update is available:
Success: WordPress is at the latest version.
Updating WordPress
- Log in to the server via SSH with the cPanel user who owns the website for which you want to make updates.
- Use the cd command to access the root folder of your website:
cd public_html/my_website
Replace public_html/my_website with the actual path to the root folder of your website.
- Run the following command to update WordPress:
wp core update
The following output will confirm the successful update:
Updating to version #.#.# (en_US)... Downloading update from https://downloads.wordpress.org/release/wordpress-#.#.#-no-content.zip... Unpacking the update... Cleaning up files... No files found that need cleaned up. Success: WordPress updated successfully.
For assistance in applying the above instructions on HostX servers please contact us. HostX offers the fastest WordPress hosting and can help you solve your problems.