
In this tutorial I will explain what WordPress automatic updates are, their types and how to enable or disable automatic updates. Knowing about WordPress automatic updates is necessary if you are running maintaining a WordPress site.
What is WordPress Automatic Updates?
WordPress automatic updates is a feature built into WordPress to update or replace the outdated code files automatically without user permission.
Types of Automatic Updates?
There are four types of Automatic Updates:
- Core Updates: Updates for the WordPress core.
- Development Updates: Updates from the development version of the site.
- Minor Updates: Updates for minor releases. Example: 3.0.1, 3.0.2 etc not 3.0.0, 4.0.0
- Major Updates: Updates for major releases. Example: 3.0.0, 4.0.0 etc not 3.0.1, 4.0.1
- Plugin Updates: Updates when a new version of plugin is released.
- Theme Updates: Updates when a new version of theme is released.
- Translation file Updates: Updates when a new translation file is available.
Core updates are further divided into three different types.
By default in WordPress Development updates, Minor updates and Translation file updates are enabled. All other automatic updates are disabled. For all other kinds of updates a message is displayed in dashboard when a update is available.
Disable all Updates
To disable all types of updates place this code in your wp-config.php file.
If you want to disable all types of via a plugin then use this filter
These code will not let any kind of update happen automatically. These code will overwrite all other automatic updates configurations codes shown below.
Enable Major, Minor and Development Updates
To enable all types of core updates place this code in wp-config.php file.
You can also use this filter
add_filter( 'allow_major_auto_core_updates', '__return_true' );
add_filter( 'allow_minor_auto_core_updates', '__return_true' );
To disable all types of core updates change all true’s to false in the above code.
Enable Plugin Updates
To enable automatic plugin updates you need to use this filter
The filter callback is passed with objects holding information about the plugin that will be auto updated. Therefore you can also enable or disable auto update for specific plugins. For example:
if ( $item->slug == 'akismet' ) ) {
return true; // Always update "akismet" plugin
} else {
return $update; // Else, use the normal API response to decide whether to update or not
}
}
add_filter( 'auto_update_plugin', 'auto_update_specific_plugins', 10, 2 );
Enable Theme Updates
To enable automatic theme updates you need to use this filter
The filter callback is passed with objects holding information about the theme that will be auto updated. Therefore you can also enable or disable auto update for specific plugins. For example
if ( $item->slug == 'qnimate-theme' ) ) {
return true; // Always update "qnimate-theme" theme
} else {
return $update; // Else, use the normal API response to decide whether to update or not
}
}
add_filter( 'auto_update_theme', 'auto_update_specific_themes', 10, 2 );
Disable Translation File Updates
To disable translation file updates use this filter