SSH into your server: Connect to your server using SSH and navigate to the root directory of your WordPress installation.
Update WP-CLI: Make sure that you have the latest version of WP-CLI installed. You can update it by running the following command: wp cli update.
Check WordPress version: Run the following command to check the current version of WordPress installed on your site: wp core version.
Backup your website: Before updating WordPress, it is recommended to take a backup of your website. You can use WP-CLI to take a backup of your database and files with the following command: wp db export and tar czvf wordpress-backup.tar.gz *.
Update WordPress: Run the following command to update WordPress to the latest version: wp core update.
Update plugins: After updating WordPress, you can update all the plugins with the following command: wp plugin update –all.
Clear cache: If you have any caching plugins installed, clear the cache to make sure that your website is functioning correctly.
Test your website: After updating WordPress and plugins, check your website to make sure that everything is working correctly.
By following these steps, you can easily update WordPress using WP-CLI and keep your website up to date and secure.