Recently, one of our readers asked how to automatically update WordPress plugins.
Keeping WordPress plugins updated is crucial for security and performance, but constant update notifications can be a headache. Many users find it annoying to have to update plugins almost every other day, and we understand that annoyance.
In this article, we will show you how to enable automatic updates for WordPress plugins, saving you time and effort. We will also show you how to exclude certain plugins from automatic updates.
When and Why Should You Automatically Update WordPress Plugins?
By default, WordPress automatically updates when a security or minor version is released. For major versions, you must initiate the update yourself. You must also install plugin and theme updates yourself.
Keeping your WordPress website updated is essential for the security and stability of your website.
The same goes for any plugins and themes installed on your website. You’ll need to install updates for plugins and themes to get new features and fixes.
However, you may have noticed that some plugins are updated more frequently than others. Many popular WordPress plugins are updated almost every week.
Some users find this a bit distracting because every time they log in there will be an update available for one or more plugins.
What if you could allow trusted developers to automatically update plugins like WordPress?
Let’s see how to automatically update plugins in WordPress.
How to Automatically Install Updates for Certain Plugins in WordPress
WordPress introduced the auto-update feature for WordPress plugins and themes in WordPress 5.5. This allows you to enable automatic updates for individual WordPress plugins and themes directly from your WordPress dashboard.
Enable automatic updates for individual plugins
Simply visit the ‘Plugins » Installed Plugins’ page within your WordPress admin area . Here you will see a list of all your installed plugins, with a link next to each one to ‘Enable auto-updates’.
You need to turn on automatic updates for each plugin by clicking on the "Enable automatic updates" link.
Enable automatic updates for your WordPress theme
For WordPress themes, you need to visit Appearance » Themes and click on the theme you want to automatically update.
This will bring up the theme information window. From here you can click the "Enable automatic updates" link to turn on automatic updates for this theme.
That’s all. WordPress will now automatically update these plugins and themes when new versions are released. You’ll receive an email notification every time a new update is installed on your site.
Set up automatic updates for all your WordPress plugins
You can set up WordPress to automatically install all plugin updates by simply adding this code to your theme’s functions.php file, a site-specific plugin, or a snippet plugin.
add_filter('auto_update_plugin', '__return_true');
This filter tells the WordPress auto-updater to automatically install plugin updates when they are available.
If you also want to automatically update the theme then you can add another code like this:
add_filter( 'auto_update_theme', '__return_true');
We recommend using the WPCode plugin to add this code. It’s the safest and easiest way to add custom code snippets in WordPress without having to edit your theme’s functions.php file.
First, you’ll need to install and activate the free WPCode plugin. If you need instructions, then see this guide on how to install a WordPress plugin .
Once the plugin is activated, head to Code Snippets » Add Snippet in your WordPress dashboard . There, find the ‘Add your custom code (new snippet)’ option and click on the ‘Use Snippet’ button below it.
From there, you need to select “PHP Snippet” as the code type from the list of options that appear on the screen.
Next, add a title to your code snippet. The title can be anything to help you remember what the code does.
Then, just paste the code above into the Code Preview box.
Finally, toggle the switch from Inactive to Active and click the Save Snippet button.
That's it. If you want to add a second code listed above, just repeat the steps.
How do I roll back to a previous version of a plugin after updating?
An incompatible plugin or theme can spell trouble for your website. Even though most good developers test their plugins thoroughly, there are always those rare bugs that can bring your site down.
The first step you should take to protect your website is to install a WordPress backup solution.
However, restoring a WordPress site from a backup can seem cumbersome. If you know which plugin or theme update caused the problem, rolling back the update is easier.
Here’s how to easily roll back a plugin or theme update. Simply install and activate the WP Rollback plugin.
Once activated, return to your WordPress site’s Plugins page. You’ll notice that there is a new “Roll Back” option underneath each plugin installed on your site.
By clicking on the Rollback button, you can roll back the plugin to any previous version you want. It can also roll back theme updates.
We hope this article helped you set up automatic updates for WordPress plugins. You may also want to check out our guide on how to choose the best WordPress plugins .
If you liked this article, you can also share it on Twitter and Facebook.
Disclosure: Some of the links in this article contain affiliate links, which means we may earn a commission if you click through to visit us, at no extra cost to you. See how SidelinePlay is funded, why it’s important, and how you can support us.
Was this helpful?