Jul 05, 2021
How to Update WordPress: A Step-By-Step Guide
It’s important to keep your WordPress website updated for multiple reasons – be it for better security or keeping compatibility issues to a minimum. If you’re looking for tips on how to update WordPress, you’ve come to the right place.
Whether you’re updating the WordPress core, themes, or plugins – we’ve got you covered.
Before Updating WordPress
Before making any changes to your WordPress site, it’s essential to be prepared for any possible missteps. This includes backing up your files and deactivating any plugins that might interfere with WordPress:
Create full a WordPress backup — errors tend to happen at the most unfortunate of times. Backups prevent permanent data loss and act as a fallback plan when you’re modifying or updating your website and something goes wrong. For more information, check out our tutorial on how to back up your WordPress files.
Deactivate all of your plugins — there are times when new changes in WordPress are not compatible with certain plugins that you have. This can result in an inaccessible website. By deactivating them, you can prevent the issue from happening once you update WordPress. This is especially true for caching plugins since they can potentially interfere with WordPress installation. If you’d like to know more, you can follow the steps shown here.
How to Update the WordPress Core?
If this is your first time upgrading WordPress core, the whole process is a lot easier than you might think.
There a four ways how you can approach this and we’re going to list every method here.
1. Updating WordPress via the Admin Dashboard
This is by far the easiest way to update WordPress as it’s only a click away.
All you have to do is log in to your WordPress dashboard. Then, check if there is a core update notification at the top of the page.
Click the “Please update now” to initiate the process. You’ll be taken to the Updates page where you’ll have to press the Update Now button again.
If it’s only a minor update, you will be shown a “success message” along with the plugin and theme update options.
On the other hand, if it’s a major WordPress release, you will see the welcome screen with a detailed summary description of what has been upgraded.
Now you can proceed to update all of your themes and plugins to make sure they are compatible with the latest version of WordPress.
PRO TIP: You can also update your WordPress version easily from the hPanel. Once you have gained to your account, simply go to Dashboard under the WordPress section. Scroll down and you’ll see the “Install the latest WordPress version” option.
2. Updating WordPress Manually via FTP
Manually updating WordPress comes in handy when you’re unable to do it via the admin dashboard for whatever reason.
You’ll have to overwrite the old WordPress core files – wp-admin and wp-includes – with the new ones. We’re going to show you how to do just that using FileZilla:
- Download the latest stable version of WordPress and unzip the files on your computer.
- Access the extracted folder and delete the wp-config-sample.php file and wp-content folder to avoid losing any important data in the process.
- Connect and log in to your WordPress site via FileZilla or your preferred FTP client. Check out our tutorial on FileZilla client configuration if this is your first time using an FTP client.
- Find the existing web host wp-admin and wp-includes directories on the right side of the panel (remote site), then right-click to Delete them.
- On the left side of the panel (local site), select the new wp-admin and wp-includes folder, then select Upload.
- Upload the rest of the WordPress unzipped files from your computer to the web host directory. Overwrite the old files by uploading new ones to the server. When a confirmation “Target file already exists” screen appears, make sure the “Always use this action” and “Apply to current queue only” options are selected.
- When the files are all uploaded, go to yoursite.com/wp-admin/upgrade.php/ to check if you’ve successfully updated your website to the new version of WordPress.
IMPORTANT: Don’t rush to replace everything inside the WordPress root directory. You can easily break your site if you do something incorrectly, so make sure to follow the tutorial carefully.
3. Updating WordPress via WP-CLI
If you’re reading this part of the tutorial, we assume you already have SSH access to your WordPress root directory in the public_html folder.
If you are not sure how to access your account via SSH, take a look at this tutorial.
Once everything is configured, here’s what you need to do proceed with updating to the latest version of WordPress:
- Once you’ve gained access to your SSH account, use the cd command on to switch to your WordPress root directory by using the following line:
PRO TIP: To list your directory contents, type in the ls command or type cd ~ to change your directory to home.
- Check if a new WordPress version is available by using this command:
wp core check-update
- If there’s a new update available, you will see a similar message:
+---------+-------------+---------------------------------------------------------------+ | version | update_type | package_url | +---------+-------------+---------------------------------------------------------------+ | #.#.# | minor | https://downloads.wordpress.org/release/wordpress-#.#.#.zip | | #.#.# | major | https://downloads.wordpress.org/release/wordpress-#.#.#.zip | +---------+-------------+---------------------------------------------------------------+
- If there are no updates available, you will see this message instead:
Success: WordPress is at the latest version.
- To start the update, run the following line:
wp core update
- Wait for the program to complete, and your WordPress will be updated automatically.
Now that you know how to update the core files via WP-CLI, let’s update your database, theme, and plugins. Here are the commands to run, respectively:
wp core update-db wp theme update --all wp plugin update --all
When the program is done processing, run the previous commands once again to confirm whether everything is updated correctly. Here’s what it should look like:
4. Updating WordPress Automatically
WordPress immediately updates its sites when minor updates are released. However, did you know you can also set major releases to be automatically updated as well?
If you lack the technical skills to give the previous methods a try, you can easily set up auto-updates using a plugin such as Easy Updates Manager. To learn how to install WordPress plugins, check out this tutorial.
You can also enable automatic WordPress updates by adding a line of code to your wp-config.php file. Here’s how to do it:
- Login to hPanel and go to File Manager under the Files section.
- Once you’re in the public_html folder, scroll down and select the wp-config.php.
- Press the Edit button located in the top menu.
- Add or change the following line:
- Click Save once you’re finished.
How to Update WordPress Themes and Plugins?
You will do yourself a great disservice if you leave your themes and plugins unattended after updating your core WordPress files. Not only that might cause unwanted errors, but it can also stop working properly entirely, messing with your site’s functionality.
To update your plugins and themes from your WordPress admin dashboard, navigate to Updates by hovering over the Dashboard menu.
This will lead you to a new page where you can update your themes and plugins separately or all at once.
NOTE: Updating your WordPress theme will get rid of all the customizations you’ve made to the theme. Avoid losing them by using a child theme, instead of editing the parent theme directly.
Why Update WordPress?
Updating your WordPress website is essential for a number of reasons. Here’s to name a few:
- Better security. New version updates fix bugs and security vulnerabilities that the older versions potentially had.
- Speed. You’ll experience improved website loading speed and performance by installing a new version of WordPress.
- Compatibility. With new updates, your site ought to be more compatible with the latest themes, plugins, or other features.
- Functionality. WordPress updates come with new implementations of new or improved quality-of-life features. There’ll be more handy options and tools that you can use to upgrade or scale up your website.
In this tutorial, we’ve learned how to update your WordPress site with the latest version. Learning how to update WordPress without breaking your site is a must-have skill for every website owner.
Before you sign off, here’s a quick recap on how to update your site to the latest WordPress version:
- Updating through the Admin Dashboard. Clicking on an automatic update message and allowing it to proceed with WordPress installation.
- Updating manually via an FTP client. Overwriting the old core files with new ones downloaded from the official WordPress repository.
- Updating via SSH and WP-CLI. Running commands WordPress core files, database, themes, and plugins via an SSH terminal.
- Enabling WordPress automatic updates. Editing wp-config.php via File Manager of your hosting control panel.
If you have any more questions, please don’t hesitate to leave a comment down below.