If you’re lucky, you may have a WordPress website that automatically updates when new versions are released. If that’s the case, then you should be all set. Nothing to do, but sit and relax. However, not all WordPress websites are configured to automatically upgrade when new versions are released. If your WordPress site is configured where it can not self-update, then you may have to update from the server console or use other means. An easy way to update WordPress content is from the server terminal. One can get to the server console via SSH or directly. Once on the terminal console, you should then be able to upgrade WordPress with ease. When you’re ready to update or upgrade WordPress via SSH terminal, continue below:
How to backup WordPress database
Before making changes to your WordPress site, it is recommended that you always back up your database content. If you’re running MySQL or MariaDB database server, the commands below are how to back up a database. Replace wp_database with the WordPress database that you want to back up. If you have a plugin that can backup WordPress content, then use it to backup WordPress before continuing below.
How to backup WordPress content
You may also want to back up WordPress content. Assuming WordPress is installed in the /var/www/wordpress, use Rsync to copy the WordPress content directory to a backup location. To do that, run the commands below. After backing up the WordPress database and content, continue below to begin upgrading WordPress.
Delete WordPress wp-includes and wp-admin folders
To begin upgrading, delete the existing wp-admin and wp-include directories. After deleting WordPress existing folders for wp-admin and wp-includes folders, go and download WordPress updated content.
How to Download WordPress content
To download the latest WordPress content, simply run the commands below. Once the content is downloaded, the next command extracts it. Unzip the download content using the commands below.
Replace WordPress content with the latest
Finally, run the commands below to copy WordPress’s latest content to the root directory. Doing this will replace the wp-includes and wp-admin folders and overwrite any other folders with newer versions. After copying the files, open your browser and browse the WordPress URL for the site to initiate the upgrade. Replace www.example.com in the URL with your domain. After a brief moment, your WordPress site should be updated with the latest files. You can then log in to see the changes. That’s it! Conclusion: This post showed you how to upgrade WordPress. If you find any error above or have something to add, please use the comment form below.