Everyone has their own preference when it comes to automatic updates. Many folks like the idea of saving time and not having to “do” anything when updates are available. The problem is that updates don’t always go as planned. Unexpected things happen, conflicts, bugs, etc. Best-case scenario you save some time. Worst-case scenario your site goes down. Personally, I prefer to disable automatic updates for all the things: WordPress core, plugins, and themes. To do it, I use the following code snippets..
Contents
Disable automatic updates via constants
This is the code snippet that I add to every site to turn off ALL automatic updates. Added via the wp-config.php file, just before the line that says, “That’s all, stop editing! Happy blogging.” Here is the magic code:
// Disable auto-updates for EVERYTHING
define('AUTOMATIC_UPDATER_DISABLED', true);
// Disable auto-updates for WP CORE
define('WP_AUTO_UPDATE_CORE', false);
// Disable auto-updates for PLUGINS & THEMES
define('CORE_UPGRADE_SKIP_NEW_BUNDLED', true);
Here we define three constants. The first constant disables all automatic updates. So technically that’s all you need. The second constant disables auto-updates for the WordPress core. The third constant disables auto-updates for plugins and themes. It’s as simple as that, and it just works.
Notes
By changing the values of the constants, you can define other configurations for automatic updates. For example, you can enable core updates while disabling plugin/theme updates and vice versa. In fact, the WP_AUTO_UPDATE_CORE constant may be one of three possible values:
true– All updates (major, minor, and dev) are enabledfalse– All updates (major, minor, and dev) are disabled'minor'– Only minor updates are enabled (major & dev are disabled)
The other two constants, AUTOMATIC_UPDATER_DISABLED and CORE_UPGRADE_SKIP_NEW_BUNDLED, are strictly boolean (true or false).
Also note that “dev” updates only happen on sites running a development version of WordPress.
Disable automatic updates via filter hooks
Instead of using constants, it’s possible to configure automatic updates using filter hooks. Going the “filter” route is somewhat more flexible. Best advice is to go with constants via wp-config.php if you simply want to disable automatic updates. For alternate configurations, using filters gives you more granular control over each aspect of the update process.
wp-config.php.Here are the filters that may be used to configure automatic updates:
// Disable auto-updates for EVERYTHING
add_filter('automatic_updater_disabled', '__return_false');
// Disable auto-updates for WP CORE
add_filter('auto_update_core', '__return_false');
// Disable auto-updates for PLUGINS
add_filter('auto_update_plugin', '__return_false');
// Disable auto-updates for THEMES
add_filter('auto_update_theme', '__return_false');
// Disable auto-updates for TRANSLATIONS
add_filter('auto_update_translation', '__return_false');
As written here, these filters all return false, which disables their respective auto-update feature. To instead enable any update feature, simply replace __return_false with __return_true.
Notes
The auto_update_core filter disables all core-related updates: major, minor, and dev. For more granular control, you can use the following alternate filters:
allow_dev_auto_core_updatesallow_minor_auto_core_updatesallow_major_auto_core_updates
These filters do exactly what their names imply. For more details, check out this WordPress article. As explained there, even when disabling auto-updates using auto_update_core and related filters, WordPress will continue making HTTP requests to the update endpoints:
https://api.wordpress.org/core/version-check/...
https://api.wordpress.org/plugins/update-check/...
https://api.wordpress.org/themes/update-check/...
If you want to stop WordPress from checking for updates, you can add the following code via must-use plugin, regular plugin, or via functions.php:
// Stop HTTP requests checking for updates
remove_action('admin_init', '_maybe_update_core');
remove_action('admin_init', '_maybe_update_plugins');
remove_action('admin_init', '_maybe_update_themes');
That’s all for now, I hope this tutorial helps you in your WordPress adventures :)



