One of the most important things a website owner should do to keep their website secure and functional is to update the Content Management System (CMS). WordPress is a valuable CMS and one of the most used on the web. WordPress is extremely versatile because of the thousands of themes and plugins available on WordPress.org and other third party sites. Similar to software programs on your computer, developers frequently send updates that provide new features and fix bugs.
Regardless of security issues that may exist in WordPress, bugs need to be fixed. When an available update can fix bugs in your software, you should update to the most stable version. Next, let’s walk through how you safely update WordPress, themes, and plugins.
Do I Need To Update WordPress?
It is hard to monitor for updates every day if you use a lot of plugins. Luckily, WordPress has made updates very easy to identify. When an update is available a notification appears in the back end of the site. This makes it easily identifiable that there is an update for WordPress, however; plugin and theme updates are slightly different.
There is an update page in the backend menu that will show you if there are updates needed for your theme or plugins. When you go to the update page, it will list all the updates your site needs and it will even give you the number of updates in the menu next to the updates page menu item.
Since WordPress is such a popular CMS, a single security hole leaves many sites vulnerable. The good news is that since WordPress is Open Source, security flaws are easily detectable and resolved quickly. When you update WordPress on your website, either manually or automatically, files are added, deleted, and replaced. If a problem occurs, WordPress can break, making your site unavailable to users.
Therefore, it is essential that you backup your site before updating WordPress. Backing up your site allows you to revert WordPress and site files in case the update fails.
Single Click Update
When WordPress released version 2.7, a feature became available to update WordPress with a single click of a button. This feature will automatically download and replace the files on its own, making it much easier to avoid errors while updating. It saves you the time and frustration of having an error occur and the need to push your site to the backup you made.
The process to update in one click is simple. All you will have to do is navigate to the backend of the site and go to the updates page. If your WordPress is not the current version, you will see a message that says, “An updated version of WordPress is available,” and two buttons.
Next, you will click the button that says update now. This will begin the single click update of WordPress. You will be led to another page that shows you the progress, and it will automatically download the latest version, deactivate plugins, replace the correct files, and reactivate your plugins. It may take a few seconds or minutes to complete; do not refresh the page during this process as you could interrupt the automatic update, causing an error.
You could also choose to press the other button that says “Download” and automatically download the most recent WordPress version to your computer in a zip file. Then, you can create a new installation or manually update your current installation.
WordPress version 3.7 introduced the automatic update feature, making it even easier to keep your WordPress version current. The CMS checks daily for minor version changes of WordPress, then download and install it if available. With the automatic update feature, you do not have to do anything to install minor updates to your version of WordPress.
By default, automatic updates only work for minor versions. Therefore, you must manually update any major WordPress version updates. You can either update manually or use the single-click method. Essentially, if you are updating WordPress version 4.0.1 to 4.0.2 it will automatically update, but if you are updating 4.0.1 to 4.1.0 it will not automatically update.
This WordPress feature is on by default on any version after 3.7, but if you want to disable this it is still possible by adding a new constant in your wp-config.php file in the root of your WordPress installation.
Add this line of code to wp-config.php:
You can also add a constant in your wp-config.php file that will enable automatic updates for major versions of WordPress as well.
This can be accomplished by adding this line of code to wp-config.php:
You may not want to edit your wp-config.php file and that is okay because you can accomplish the same settings change by adding a line of code to your functions.php file.
This can be accomplished by adding these lines of code to functions.php:
// Disable automatic minor updates
// Enable automatic major updates
// Enable development updates
Automatic updating is always your best option as it lowers the possibility of errors, though you can still update WordPress manually. It is critical to be careful if you choose to manually update to the latest version because it’s easy to make an error and break your installation.
Steps to Manually Update WordPress:
- Download the most recent version of WordPress.
Use the download button on the updates page or by downloading it from wordpress.org. You will download an archive and will need to unpack it.
- Disable all of your plugins.
make sure that none of your plugins will cause a bug during the installation process. You can accomplish this quickly by navigating to the plugins page, select all your plugins, and then press the deactivate button.
- Delete and replace the files.
You will need to delete the wp-includes and wp-admin folders and upload the new folders in their place.
- Upload the new content files.
Upload and overwrite the files in the wp-content folder with the new files. This will update old default themes and plugins.
- Do the same with the root directory files.
Replace the current files with the new files by uploading them. Check the file named wp-config-sample.php from the new files against the current wp-config.php file. You will then copy and paste and new code from wp-config-sample.php to wp-config.php.
- Check for .maintenace file.
If doing a manual update to resolve a problem caused during an automatic update, you will need to delete the file .maintenance. Often this happens when an automatic update fails.
- Update your database.
Navigate to your administration panel to see if you need to do this. If you do, a message with a link will appear. You will click the link, and your database will automatically update.
- Reactivate all your plugins.
You will now need to reactivate all the plugins you use on your site. Reactivate the plugins individually to ensure there are no conflicts with your plugins and the current version of WordPress.
Update WordPress Plugins & Themes
It is equally crucial to keep your plugins and themes updated as well as your WordPress version current. A bug in a plugin or theme can cause a critical error in your installation of WordPress.
One-click Plugin & Theme Update
Just as you can with WordPress, you can update plugins and themes with the one-click option. You will navigate to the updates page from your WordPress dashboard. If some plugins or themes need to be updated, they will appear on this page. Next, you will select the plugins you are going to update and press the update plugins button. You will do the same with any themes that need updating. You will be led to another page and giving the progress of your updates.
Automatic Plugin & Theme Update
You can set plugins to automatically update by adding code to the functions.php file of your theme or plugin. You cannot enable plugin and theme automatic updates by adding a constant in the wp-config.php file.
// Enable automatic updates for plugins
// Enable automatic updates for themes
Manual Plugin & Theme Update
Like WordPress, it is preferable that you automatically update themes and plugins. However, you may still choose update plugins and themes manually. As stated before, accuracy is essential if you update plugins and themes manually.
To manually update your plugin or theme, you will need to download the latest version from wordpress.org or the third-party website where you purchased it. You will download an archive file that you will need to unpack.
The plugin may be a single file that you will upload directly to the plugins subdirectory of wp-content. However, plugins are typically in folders, and you will upload and override the current files of the plugin. The last thing you will do is reactivate the plugin, making sure there is no conflict with your WordPress installation.
The process is the same for manually updating themes, except when you deactivate the theme you will need to select a different theme for the site.
Need Advice On How To Updated WordPress?
With this advice, we are confident you can keep your WordPress updated. However, if you are having a problem with an update, please feel free to contact us with your questions. We want to help you keep your website safe and up to date.