Building a WordPress website might be a one-and-done process, but maintaining it is ongoing. A key maintenance task is making sure your website is running on the latest version of WordPress.
To ensure you can check this item off your to-do list, we’ll cover how to update your WordPress software manually and how to enable automatic updates.
Why Update WordPress
Every part of your WordPress website, from plugins to themes to the core software, should be kept up-to-date. Updating your core files in particular can help improve your site’s functionality, performance, compatibility, and — most importantly — security.
WordPress periodically rolls out major version updates as well as maintenance releases and security updates. Each of these releases might include improvements, bug fixes, and fixes to more critical security vulnerabilities. For example, the latest release — WordPress version 5.8.1 — included fixes for three major vulnerabilities, including a cross-site scripting (XSS) vulnerability in the Gutenberg block editor. If you don’t update your core software, then you are leaving your site vulnerable to known threats as well as known threats.
In fact, according to the latest Sucuri report, approximately 49% of hacked WordPress websites are vulnerable at the point of infection. This indicates that website owners continue to fall behind on updating core files and extensible components like themes and plugins.
Before updating to the latest version of WordPress, make sure you have a complete backup of your website. A complete backup includes your core files, plugins, theme, database, and media uploads. This should be saved locally on your computer or in the cloud (like in Google Drive).
Having a backup of your site will enable you to restore your site in case anything goes wrong during the update process (which is unlikely but better to be safe than sorry).
You can follow the step-by-step process in the post How to Backup Your WordPress Site Manually or With a Plugin.
Once you have created and saved a backup of your site, you’re ready to begin the update process.
How to Update Wordpress Manually
There are three ways to update the WordPress software manually. We’ll start with the easiest way and move onto alternatives that might be better suited for advanced users.
How to Update WordPress Manually via Dashboard
WordPress offers one-click updates directly in the admin dashboard. This method is the easiest way to update your core software. The steps are outlined below.
- Go to Dashboard > Updates
- If you see the message “An updated version of WordPress is available,” click Update Now.
- To double check that the update was successful, you can log out and log back in and return to this Updates screen. You should now see the message “You have the latest version of WordPress.”
If you can’t log in to your WordPress dashboard, then you will have to try one of the update methods below.
How to Update WordPress Manually via FTP
If you’re unable to log in to your WordPress dashboard for some reason, or experience a permissions issue, then you can update the software via an FTP client.
- Download the latest WordPress .zip file.
- Extract the .zip file.
- Log in to your site’s server via FTP.
- Navigate to the wp-content folder.
- Right click the plugins folder and rename it “plugins.hold.” This will temporarily deactivate your plugins.
- Delete the wp-includes and wp-admin folders.
- Upload the new wp-includes and wp-admin folders from the .zip file you extracted earlier.
- Upload individual files from the new wp-content folder to your existing wp-content folder. This will overwrite the existing files. Only delete the files in your existing wp-content folder that are being overwritten by new files.
- Upload all new loose files to your public_html folder.
- Rename the “plugins.hold” file back to “plugins.”
- You should be all set. To test it, visit your /wp-admin page. You’ll likely be prompted to log back in. Once logged in, you should not see an update option for the WordPress core in your dashboard.
If you can’t log in to your FTP client or use a web browser, then you will have to try the update method below.
How to Update WordPress Manually via WP-CLI
WP-CLI is the command-line interface for WordPress. It allows you to update plugins, configure multisite installations, and perform other tasks without using a web browser.
- First, you have to install WP-CLI. Before installing it, please make sure that your environment is “UNIX-like” (OS X, Linux, FreeBSD, Cygwin) and that you’re running a relatively up-to-date version of PHP and WordPress (PHP 5.6 or later and WordPress 3.7 or later).
- Download the wp-cli.phar file using wget or curl:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
- Next, verify that the Phar file is working:
php wp-cli.phar --info
- Then, make the file executable and move it to somewhere in your PATH. For example:
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
- Run wp --info to check that WP-CLI was installed successfully. You should see something like this:
$ wp --info
OS: Linux 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64
PHP binary: /usr/bin/php
PHP version: 8.0.5
php.ini used: /etc/php/8.0/cli/php.ini
MySQL binary: /usr/bin/mysql
MySQL version: mysql Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
WP-CLI root dir: /home/wp-cli/
WP-CLI vendor dir: /home/wp-cli/vendor
WP_CLI phar path:
WP-CLI packages dir: /home/wp-cli/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config: /home/wp-cli/wp-cli.yml
WP-CLI version: 2.5.0
- Now you can run the following command line:
wp core update
- This defaults to updating WordPress to the latest version. You should see the following messages as the update is completed.
# Update WordPress
$ 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.
Let’s say you don’t want to go through these steps every time WordPress releases a new version of its core software. In that case, you can configure your site to update automatically.
How to Update Wordpress Automatically
WordPress allows you to set your website to automatically update when a new version of WordPress is available. You can do it in your admin dashboard, or using cPanel.
How to Update WordPress Automatically via Dashboard
- Go to Dashboard > Updates.
- It should say “This site is automatically kept up to date with each new version of WordPress.”
- If it doesn’t, click the hyperlinked text “Enable automatic updates for all new versions of WordPress.”
How to Update WordPress Automatically via cPanel
If you don’t have access to your dashboard or don’t see the “Enable automatic updates for all new versions of WordPress” link, then you can add a line of code in your wp-config.php file.
- Login to cPanel.
- Go to the File Manager under the Files section.
- Click the public_html folder.
- Click the wp-config.php.
- Press the Edit button in the top toolbar.
- Add or change the following line:
- Click Save.
Now, automatic updates for major and minor releases and development purposes are enabled.
Keeping Your WordPress Software Up-to-Date
No matter how you decide to perform software updates, it’s important you remain diligent that your site is running the latest version of WordPress. It will help ensure your site remains secure and that you keep providing the best experience to your users as possible.