How to disable WordPress automatic updates
WordPress can automatically update itself to latest versions. The auto update feature of WordPress is really important for keeping your website secure and up-to-date.
Despite the benefits of WordPress automatic updates, there is a chance that your website may break on updating to the latest version of WP. In this article, we show you how to disable automatic updates in WordPress.
Why WordPress updates automatically?
WordPress incorporated the auto update feature to fix the issue of vulnerable installations. Many times, websites are not regularly maintained and the installed version of WordPress becomes obsolete.
To mitigate the risks, WordPress updates itself to the latest versions when required. Sometimes, the automatic update can also include themes and plugins. By default, automatic background updates only happen for plugins and themes in special cases, as determined by the WordPress.org API response, which is controlled by the WordPress security team for patching critical vulnerabilities.
For security and performance, it is highly recommended that you update your website and blogs to the latest version. WordPress updates are released to add new features as well as fix security vulnerabilities.
If you continue to use an older version of WordPress with known security vulnerabilities, hackers exploit the issues to take control of your website for defacing your site and/or using your website for their own use such as spam and phishing.
Despite the obvious benefit of automatic WordPress updates, sometimes you need to control the updates. An automatic update of WordPress can break your website if it has custom functions.
Disable automatic WordPress updates using plugin
For beginners and non-techies, the easiest way to do disable auto update for WordPress is using Easy Updates Manager plugin. Simply install and activate the plugin. Go to the plugin settings page to set your preferences.
Disable automatic WordPress updates via wp-config.php
Though plugins are easy to use, it is often better to simply edit your WordPress installation to avoid unnecessary burden on your WordPress website.
You can disable automatic updates in WordPress by adding this line of code in your wp-config.php
file.
/* Disable WordPress Automatic Updates */
define( 'WP_AUTO_UPDATE_CORE', false );
/* Disable WordPress Plugin Automatic Updates */
add_filter( 'auto_update_plugin', '__return_false' );
/* Disable WordPress Theme Automatic Updates */ add_filter( 'auto_update_theme', '__return_false' );
/* Disable WordPress Automatic Updates */ /* The following code will disable all updates, the core WordPress, themes and plugins. */ define( 'AUTOMATIC_UPDATER_DISABLED', true );
Simply copy the code block(s) that you want, paste them in your wp-config.php file and save. That’s all it takes.
The wp-config.php file contains the website core configuration settings. You can find this file in the main folder on your server where WordPress is located.
For instance, if your WordPress site is located at the top domain (eg: website.com), this file will be present in public_html folder if you are using Apache web hosting server.
Disable automatic WordPress updates via filter
One can also control WordPress core, theme and plugin auto updates via filters (functions) in your theme or plugin.
Using filters allows for fine-tuned control of automatic updates. Though you can add the filter in theme or plugin, the best place to put these filters is in a must-use plugin so as to keep the settings separately.
/* Disable All WordPress updates */
add_filter( 'automatic_updater_disabled', '__return_true' );
/* Enable / Disable WordPress core updates */
add_filter( 'auto_update_core', '__return_true' );
add_filter( 'allow_dev_auto_core_updates', '__return_true' ); // Enable development updates
add_filter( 'allow_minor_auto_core_updates', '__return_true' ); // Enable minor updates
add_filter( 'allow_major_auto_core_updates', '__return_true' ); // Enable major updates
/* Enable / Disable WordPress plugin updates */
add_filter( 'auto_update_plugin', '__return_true' );
/* Enable / Disable WordPress theme updates */ add_filter( 'auto_update_theme', '__return_true' );
If you are happy allowing WordPress automatic updates, but don’t want the email notification each time it updates, add the following filter in your plugin or theme (functions.php).
/* Disable WordPress update emails */ add_filter( 'auto_core_update_send_email', '__return_false' );