The automatic update feature of WordPress works great and it has many advantages. No longer do you need to hit the ‘Update’ button, as it automatically updates whenever a maintenance or security update is available. However, there are ways to disable automatic updates, and apart from that, there’s also a way to enable WordPress automatic updates for major releases.
While this new automatic update feature is perfect and needs no tweaking, some of you might also want to enable automatic updates for themes and plugins as well. Fortunately, this is possible (from WordPress 3.7 onwards) and here’s how you can do this.
Before we move forward, note that automatic plugin and theme updates are disabled by default. You’ll need to manually enable them by adding a small line of code to your theme’s functions.php file.
Now, there’s a reason why automatic updates are disabled by default for plugins and themes. If enabled, and when a new version is released, you’ll lose all your customizations that you’ve made in the old theme, and you won’t even get a chance to backup your settings and files. For example; if you’ve heavily customized the CSS of Twenty Thirteen theme, and if a new version is released, then WordPress will automatically update the theme to the new version and you’ll lose all your customizations. The same goes for plugins as well. That’s why, you’ll need to think twice before enabling automatic updates for theme and plugin. But if you really want to do this, then here’s how it can be done.
Enable Automatic Updates for Theme
If you want to enable, or turn on automatic updates for theme, then simply add the below filter to your theme’s functions.php file:
add_filter( 'auto_update_theme', '__return_true' );
To disable automatic updates for theme, remove this line or change ‘true’ to ‘false’.
Enable Automatic Updates for Plugin
To enable automatic updates for your active plugins, add the following filter to your theme’s functions.php file:
add_filter( 'auto_update_plugin', '__return_true' );
To disable automatic updates for plugin, remove this line or change ‘true’ to ‘false’.
Well, that was easy right? If you’ve got any questions, then feel free to ask in the comments section below.