automaticupdates
How to Enable Automatic Updates for WordPress Plugins
December 5th, 2018 in Wordpress |

Recently one of our readers asked how they can automatically update WordPress plugins. Many users find it annoying that almost every other day they have to update a plugin. In this article, we will show you how to enable automatic updates for WordPress plugins. We will also show you how to exclude some plugins from automatic updates.

When and Why You Should Automatically Update WordPress Plugins?

By default, WordPress can automatically update itself when a security or minor release is available. For major releases, you have to initiate the update yourself. You also have to install plugin and theme updates yourself.

Keeping your WordPress site updated is crucial for security and stability of your site.

Same goes for all plugins and themes installed on your website. You need to install updates for themes and plugins to get new features and fixes.

However, you may have noticed that some of them are updated more frequently than others. A lot of popular plugins are updated almost weekly.

wordpress-updates

Some users find it a bit distracting, that whenever they log in there is an update available for one or more plugins.

What if you could allow trusted developers to auto-update plugins similar to WordPress.

Let’s take a look at how you can automatically update plugins in WordPress.

Setting up Automatic Update for All WordPress Plugins

You can set WordPress to automatically install all plugin updates by simply adding this code to your theme’s “functions.php” file or a “site-specific plugin”.

1
add_filter( 'auto_update_plugin', '__return_true' );

This filter tells WordPress automatic updater to automatically install plugin updates when they’re available.

If you also want to automatically update your themes, then you can add another code like this:

1
add_filter( 'auto_update_theme', '__return_true' );

 

How to Automatically Install Updates for Some Plugins in WordPress

If there are a few plugins that are updated more frequently, then you may want to just enable automatic updates for those plugins.

Another situation is when you don’t want to update specific plugins.

Here is how you can include or exclude plugins from automatic updates.

The first thing you need to do is install and activate the Automatic Plugin Updates plugin.

Upon installation, you need to visit Settings » Automatic Plugin Updates page to configure plugin settings.

selectivepluginupdates

You can select the plugins you don’t want to automatically update. You can also enable email notifications for Automatic updates. Once you are done, click on the save changes button to store your settings.

That’s all, the plugin will now automatically update all plugins except for the ones you have excluded.

Note If you are using this plugin, then you don’t need to use the previous method of adding the “auto_update_plugin” filter.

How to Rollback to a Previous Version of Plugin After Update?

Plugin or theme incompatibilities can cause trouble for your website. Even though most good developers thoroughly test their plugins, there are always rare bugs that can cause your site to break.

The first step you should take to protect your website is to install a “WordPress backup” solution.

However, restoring your WordPress site from a backup seems like a lot of work. If you know what plugin or theme update caused the problem, then it would be easier to just rollback the update.

Here is how you can easily rollback plugin or theme updates. Simply install and activate the “WP Rollback” plugin.

Upon activation, go back to plugins page on your WordPress site. You will notice a new Rollback option below each plugin installed on your site.

rollbacklink

Clicking on Rollback will allow you to rollback your plugin to any previous version you want. It can also rollback theme updates.

We hope this article helped you set up automatic updates for plugins in WordPress.