Back in 2013, the WordPress 3.7 introduces the automatic update feature. There are 4 types of updates and that includes, the WP core, plugins, themes and languages.
Although updates are a good thing to do, from a security point of view, there are some aspects that you will want to take into consideration when doing an update.
So you may want to choose the time of the update, you may want to choose what to update and most of all you would like to take a full backup, just in case things don’t go out well, specially when updating themes.
So if you want to have it all controlled and take decisions after you first test everything, you can completely disable all automatic updates by adding this line to your wp-config.php .
Disable WordPress Auto Updates:
1 |
define( 'AUTOMATIC_UPDATER_DISABLED', true ); |
WordPress sees two types of updates: minor and major. Major updates add additional functionality to the WordPress platform. This can be easily identified as WordPress 3.9, 4.0, 4.1 etc.
Minor updates are the updates of a major version of WordPress that was released to correct security holes and correct bugs. Their version number increases by 0.01. For example 4.2.1, 4.2.2, 4.2.3 etc.
By default, WordPress is configured to apply all minor updates automatically as soon as they are released.
Enable Core Updates for Minor Releases (default):
1 |
define( 'WP_AUTO_UPDATE_CORE', 'minor' ); |
If you want to disable core updates, you can do that by using the following line of code in your config file.
Disable All Core Updates
1 |
define( 'WP_AUTO_UPDATE_CORE', false ); |
YOu can also install automatically all minor and major updates of WordPress by adding the following code to wp-config.php.
Enable All Core Updates, Including Minor and Major:
1 |
define( 'WP_AUTO_UPDATE_CORE', true ); |
There are also other ways to achieves this. For example you can use filters in your themes function or in your plugin files.
Use filters to change updates status
Here is a simple way to control all WordPress core automatic update
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// Disabling All Updates Via Filter add_filter( 'automatic_updater_disabled', '__return_true' ); // Core Updates via Filter add_filter( 'auto_update_core', '__return_false' ); //disable development updates add_filter( 'allow_dev_auto_core_updates', '__return_false' ); //disable minor updates add_filter( 'allow_minor_auto_core_updates', '__return_false' ); //disable major updates add_filter( 'allow_major_auto_core_updates', '__return_false' ); |
And you can also control automatic updates of themes and plugins by using this filters:
1 2 3 4 5 |
// Disable automatic updates for All plugins: add_filter( 'auto_update_plugin', '__return_false' ); // Disable automatic updates for All themes: add_filter( 'auto_update_theme', '__return_false' ); |
And finally here is how you can disable the automatic update of the translation files
1 2 |
// To disable translation file updates, use the following: add_filter( 'auto_update_translation', '__return_false' ); |
Hope this helps you in your projects, it certainly helped me