Almost all software applications release updates every now and then. These updates either fix vulnerabilities in the software or add new features.
The open-source WordPress CMS platform is no exception. A hard-working team of volunteers is constantly making changes to the source code in order to fix any bugs or vulnerabilities and to add new features.
Usually, any update is thoroughly tested to make sure that it doesn’t break a website before being pushed on users. This means that there is very little chance of your website going down due to any changes brought upon by the updates. However, it can still happen every now and then.
You might consider disabling automatic updates if you don’t want your site to break down unexpectedly and you prefer to retain control over the update schedule.
In this tutorial, I will cover the topic of WordPress updates in detail and tell you about three methods that you can use to disable automatic updates.
What Gets Updated in Automatic Background Updates?
Not every WordPress user is tech-savvy, and some of them might not even be aware of the importance of regularly updating their website. This can potentially lead to a lot of websites being run on outdated, vulnerable code. WordPress 3.7 introduced the concept of automatic updates to tackle this issue.
A WordPress website requires updates of the following four different components to continue working in an optimal manner.
Core Updates
These updates are meant for the WordPress core that ships with each installation of WordPress. The core updates themselves can be divided into three groups:
- Major core updates generally introduce some big new features and improve upon existing features. These updates also offer bug fixes and patch security vulnerabilities.
- Minor core updates are usually meant to fix any bugs that were introduced during the major update.
- Core development updates contain the latest changes made to the core. These are generally used by theme and plugin developers to test for compatibility.
Prior to WordPress 5.6, only minor core releases were updated automatically. However, both minor and major core releases are now updated automatically starting from version 5.6.
If your site is already running a development version, then you will also have automatic updates enabled for future development versions.
Plugin Updates
Plugins enhance the functionality of a WordPress website. You can use them for a lot of purposes such as selling products, compressing images, and so on. Just like WordPress core updates, plugins also require timely updates to fix bugs and add new features.
Theme Updates
Themes are usually installed to make your website more appealing and have a design that serves the core purpose of creating the website. Themes also receive regular updates to improve the design or patch any security vulnerabilities.
Translation File Updates
WordPress is used all over the world by people who might not necessarily know English. This means that it is important for WordPress to have language packs for the WordPress core and optionally plugins and themes.
It is highly unlikely that updates to language packs will break your website. Therefore, these language packs are updated automatically with each update to the WordPress core.
Plugins and themes are auto-updated only in special cases for patching critical vulnerabilities.
The effect of automatic theme updates can be minimized by using child themes to make your modifications.
Disable Automatic Updates Using a Plugin
Using a plugin is one of the most beginner-friendly ways to disable automatic updates in WordPress. There are quite a few WordPress plugins that you can use to disable automatic WordPress updates.
The one that I really liked was Easy Updates Manager as it offers a lot of control over the updates even in its free version. Once you have installed and activated the plugin, you can navigate to Dashboard > Updates Options from the WordPress admin dashboard to see all the update options.
Head over to the General tab to configure some general update options. As you can see in the screenshot below, I have disabled the theme and plugin auto-updates while keeping the translation updates enabled.
You can also individually control the plugin and theme updates by visiting the Plugins and Themes tabs.
Some people might not want to install a plugin to disable automatic updates. In this case, you can use one of the two methods listed below.
Disable Automatic Updates Using the wp-config.php File
The wp-config.php file is one of the most important files that gets shipped with all WordPress installations. This file is located in the root directory of your WordPress installation and contains important configuration information. This includes database connection information, authentication keys, and so on.
Interestingly, this file does not come included when you download WordPress. It is only generated later based on the information that you provided during the installation process.
You can make changes to this file to do a lot of things such as disabling post revisions, overriding file permissions, and so on.
Add the following line to your wp-config.php file to disable all types of WordPress automatic updates.
1 |
define( 'AUTOMATIC_UPDATER_DISABLED', true ); |
It is highly recommended that you don’t actually enable this option unless you know exactly what you are doing. Automatic updates keep your website secure, so disabling them can cause vulnerabilities.
You might feel that setting the AUTOMATIC_UPDATER_DISABLED
variable to true
is too drastic a step. In this case, you can use the WP_AUTO_UPDATE_CORE
variable for better control over the update behavior. This flag or variable can have three values:
- true: This is the default value for development websites and enables automatic updates for major, minor, and development releases.
- false: Setting this variable to false will disable all kinds of updates to your WordPress core.
- minor: This value will keep the minor updates enabled for your website, while the major and development updates will be disabled. This is the default value for regular websites.
Adding the following line to wp-config.php will disable all types of updates to the WordPress website.
1 |
define( 'WP_AUTO_UPDATE_CORE', false ); |
Disable Automatic Updates Using the functions.php File
You can have more granular control over the updates of your WordPress website with the help of some hooks that can be added to your active theme’s functions.php file.
Add the following line to the functions.php file to disable automatic updates for all plugins:
1 |
add_filter( 'auto_update_plugin', '__return_false' ); |
Add the following line to the functions.php file to disable automatic updates for themes:
1 |
add_filter( 'auto_update_theme', '__return_false' ); |
Add the following line to the functions.php file to disable automatic updates to translation files:
1 |
add_filter( 'auto_update_translation', '__return_false' ); |
Add the following line to the functions.php file to disable automatic updates to the WordPress core:
1 |
add_filter( 'auto_update_core', '__return_false' ); |
You can also disable specific types of core updates by adding the following lines to your functions.php file:
1 |
add_filter( 'allow_dev_auto_core_updates', '__return_false' ); |
2 |
add_filter( 'allow_minor_auto_core_updates', '__return_false' ); |
3 |
add_filter( 'allow_major_auto_core_updates', '__return_false' ); |
Using the __return_false
callback function allows us to easily return false from any filters.
Final Thoughts
We have covered a lot of concepts related to WordPress updates in this tutorial. We learned about different types of updates and why they are important to keep your website secure and running at an optimal level. After that, we learned how to disable updates either by using a plugin or with code by editing the wp-config.php or functions.php file. I recommend using a plugin if you have never written any code before. Otherwise, you can make changes to the functions.php file for more granular control over updates.