Keeping your WordPress plugins and themes updated is one method to protect your site from hackers. It’s also a way to make sure the site stays functional and efficient. Setting these updates to occur automatically can be a time saver while making sure the files are current as they are published.
In this tutorial, I’m going to show you how to automatically update WordPress plugins. It’s a very simple process that will help streamline the site and keep all of your components working properly.
Why Update Your Plugins
A lot of times, publishers will update plugins to fix bugs or programming issues. In some cases, these fixes may solve problems that many of you have with a certain tool. This is exceptionally helpful if you found a plugin that works perfect for what you’re trying to accomplish.
Making sure plugins play nice with others is another reason why developers publish updates. This is especially true when it comes to making sure the coding works perfectly with a new version of WordPress. You may notice a lot of plugins and themes are updated within 48 hours of a new WordPress version.
If an exploit is discovered in a plugin, the developer will often issue an update after fixing the code. This is to prevent anyone from hacking a website through holes within the code itself. The last thing a legitimate developer wants is a website being compromised because of something that was not correctly placed within the plugin.
One of biggest reasons why I keep everything updated is because sometimes developers add new functionality. For example, I remember when Yoast SEO had fewer tools for optimization available than what is provided today.
Using Companion Auto Update
There are a lot of tools available to automatically update WordPress plugins. In this tutorial, I am going to demonstrate Companion Auto Update. It’s a simple plugin that allows you to set various elements of WordPress. Currently, it’s also one of the more actively updated tools available in the system.
You will need to install the plugin before you can continue to enable automatic updates in WordPress.
Install and activate the Companion Auto Update plugin.
Go to the Tools section of WordPress and click “Auto Updater.”
By default, Companion will have four main components of WordPress selected for auto updates. These are:
- WordPress core files
- Translation materials
You can select or deselect any element you wish for automatic updates. However, I suggest leaving the selections as-is to provide the best experience for keeping your site functional.
You can also change email notifications upon updating the various elements. However, you want to be careful when setting these options. If you have a lot of plugins and themes, your inbox could be quickly flooded with update messages.
Once you’re done making your selections, click “Save Changes.”
Inserting Code to Update All Plugins
What if you wanted to add a snippet of code to update all of your plugins without installing anything? You can actually do this with a single line of text.
Go to the Appearance area of WordPress and click “Editor.”
Your primary theme should display by default. If not, select the theme you want to edit.
Click on “functions.php” from the list on the right.
Add the following code into the functions.php file:
Click the “Update File” button on the bottom of the page.
Keep in mind you will need to add this snippet of code again if you change the theme. This only works for the layout you’re currently using.
When Should You Not Automatically Update Plugins or Themes?
The only time when you may possibly not want to automatically update plugins or themes is when you’ve made customized changes to files. For instance, the coding above can easily be overwritten if the theme has an update. At which point, you would need to input the code again.
This is one of the reasons why many people prefer to use child themes instead. They are often easier to manage and customizations are not lost in the event of an update. This is kind of like keeping a backup copy of your theme allowing you to make adjustments should the parent layout be updated.
Keeping the Site Efficient
Updating is one of the easiest ways to keep the site efficient and operating as it was intended. It protects you from problems that may arise while possibly adding new functions to your tools. Never underestimate the value of keeping files current. It may just save you a great deal of frustration and downtime.
Do you use a lot of plugins on your site? How often do you perform routine backups?
Author: Josh Dargie
My name is Josh Dargie and I’m the Operations Manager at GreenGeeks. I’ve been with the company since 2009. I have over 16 years of experience working with and for various web hosting providers specifically in development, day-to-day operations and customer service.