Categories
WordPress

How to Disable WordPress Automatic Updates

Sometimes you need to disable automatic updates for WordPress.

It’s important to stay up to date with WordPress core, plugins, and theme updates for website performance, compatibility, and security.

But sometimes these updates can cause a problem for you, such as breaking your site.

And the chances are increased, for example, when you have more plugins on your website.

WordPress allows you disable automatic updates in different ways, and selectively for different kinds of updates.

Today I’ll show you some of the different ways you can do exactly that.

Why Update WordPress?

It is industry standard that your WordPress website should always be kept up to date.

This is in order to ensure that your website’s version of WordPress has  the most recent technology, bug fixes, and vulnerability patches.

When a vulnerability is discovered in WordPress, a new version will be released to address the issue.

When this happens, the information to exploit the old vulnerability becomes known to the public.

This now makes older versions of WordPress even more open to attack.

And it’s one of the primary reasons why you should keep WordPress updated.

Why Update Plugins and Themes?

Plugins are packages of code that extend the core functionality of WordPress.

They are made up of PHP code and can include other assets, such as JavaScript, CSS, and images.

Themes can be made up of HTML, CSS, PHP files as well as JavaScript and graphics.

Similar to WordPress itself, themes and plugins can be a key point of weakness when it comes to security.

As such, plugins and themes that are outdated can become more vulnerable to security exploits.

Why Disable WordPress Automatic Updates?

You’ll often hear why you should always keep WordPress, plugins, and themes updated.

But you usually don’t hear why auto updates themselves can be problematic.

With all of the code, files, and other assets that make up WordPress, plugins, and themes, problems can arise when everything has to mix and play together.

For example:

  • Sometimes a WordPress core update can result in a certain plugin no longer working properly
  • Sometimes a plugin update might break some crucial feature on your site, especially if its reliant on another plugin (e.g. a WooCommerce add-on)
  • If you have a bulky WordPress theme that hooks into other parts of your site, updating it could break something crucial
  • Sometimes plugin developers can even release updates with bugs, that take some time to then get fixed

For example, in 2018, due to a bug slipping by Yoast’s team, many websites that updated to the new version of Yoast SEO suffered issues.

yoast seo bug 2018 disgruntled customer
Disgruntled Yoast customer after the bug caused their site to lose rankings.

Specifically, the plugin’s settings that redirect media attachment URLs to the posts themselves would set itself from ON to OFF.

This resulted in websites having hundreds-thousands of media attachment pages indexing in Google, which it sees as thin-content.

I’ve personally experienced a disastrous problem several years ago when the All In One SEO plugin had an update bug.

In which, it caused my site to experience the white screen of death; the result of an update causing problems with a certain version of PHP.

How I Handle Automatic Updates

Personally, I don’t take any chances with my sites anymore.

I disable all automatic updates.

Then, when a new version of WordPress, a plugin, or my theme is released, I manually update and test it on a local copy of my website.

If there are multiple items that require updates, I will update them manually one-by-one.

This allows me to rule out issues and quickly resolve those which arise, because I’ll know which update is responsible.

How to Disable WordPress Auto-Updates

WordPress has 4 different types of automatic background updates:

  1. Core updates
  2. Plugin updates
  3. Theme updates
  4. Translation file updates

As of WordPress 5.6 and above, every new site has automatic enabled for both minor and major releases of WP.

How to Disable All WordPress Automatic Updates

To completely disable all types of automatic updates, core or otherwise, add the following to your wp-config.php file:

define( 'AUTOMATIC_UPDATER_DISABLED', true );

How to Disable WordPress Core Automatic Updates

You can disable automatic updates for major releases via the WP_AUTO_UPDATE_CORE constant.

There are three ways to define this constant, either to enable or disable major and minor updates.

The following are added to your wp-config.php file:

To disable minor and major WordPress updates:

define( 'WP_AUTO_UPDATE_CORE', false );

To enable minor and major WordPress updates:

define( 'WP_AUTO_UPDATE_CORE', true );

To enable minor updates but disable major WordPress updates:

define( 'WP_AUTO_UPDATE_CORE', minor );

Controlling Updates Within WP Dashboard

As of WordPress 5.5, you can selectively disable or enable theme and plugin auto-updates from within your WP dashboard.

These updates can be enabled or disabled on a theme-by-theme and plugin-by-plugin basis.

How to Disable Plugin Automatic Updates

At the plugins page, there is a column called “Automatic Updates”.

Here you can choose which plugin to enable or disable auto-updates for.

wordpress automatic plugin updates from wp dashboard

How to Disable Theme Automatic Updates

In Appearance->Themes, select the theme you want.

You’ll see a hyperlink for enabling or disabling auto-updates.

wordpress automatic theme updates from wp dashboard

Disabling Core, Plugin, and Theme Automatic Updates with Filters

WordPress also allows you to disable automatic updates using filters.

It’s recommended to add the snippets below into a must-use plugin.

Must-use plugins (a.k.a. mu-plugins) are plugins installed in a special directory inside the content folder and which are automatically enabled on all sites in the installation.

Must-use plugins do not show in the default list of plugins on the Plugins page of wp-admin – although they do appear in a special Must-Use section – and cannot be disabled except by removing the plugin file from the must-use directory, which is found in wp-content/mu-plugins by default.

Disable All Automatic Updates

You can disable all auto-updates with the following filter:

add_filter( 'automatic_updater_disabled', '__return_true' );

Enable WordPress Core Updates

You can enable all core-type updates using the following filter:

add_filter( 'auto_update_core', '__return_true' );

Selectively Disable or Enable WordPress Core Updates

If you don’t want to enable or disable all three types of core updates, you can selectively choose.

These three filters allow you to do that:

  • allow_dev_auto_core_updates
  • allow_minor_auto_core_updates
  • allow_major_auto_core_updates

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' );   

Alternatively, you can enable each of these core updates by simple changing _return_false to _return_true.

Disable Plugin Updates via Filter

To disable or enable updates for all plugins, you can use the auto_update_$type filter.

$type is then replaced with “plugin”.

Disable all plugin updates

add_filter( 'auto_update_plugin', '__return_false' );

Alternatively, you can enable plugin updates by simple changing _return_false to _return_true.

Disable Theme Updates via Filter

To disable or enable updates for all themes, you can use the auto_update_$type filter.

$type is then replaced with “theme”.

Disable all theme updates

add_filter( 'auto_update_theme', '__return_false' );

Alternatively, you can enable theme updates by simple changing _return_false to _return_true.

How to Rollback an Update to a Previous Version

If an update has gone through and caused a problem for your site, you’ll probably want to rollback to the previous version.

A simple way of achieving this is with the WP Rollback plugin.

wp rollback

With the click of a button, you can rollback any plugin or theme to a previous version from the WordPress.org repository.
wp rollback plugin rollback to previous version

Conclusion

As you’ve seen, disabling or enabling the various WordPress updates as well as plugin and theme updates isn’t hard to do.

Hopefully, this tutorial on disabling WordPress automatic updates has helped you deal with your site’s update plan.

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *