Configuring WordPress automatic updates

Last updated on January 07th, 2020 by Mark Grima. Filed under WordPress Admin Tips

We all know how important it is to keep the WordPress core, plugins, and themes up to date. Failing to do so will leave your website exposed to malicious hacks.

Luckily, WordPress has had automatic background updates since version 3.7. However, by default automatic updates only apply to minor releases. For example from 5.3.1 to 5.3.2.

In this article we will look into how you can configure automatic updates and enable them for WordPress major version updates, plugin and theme updates. We will also see how you can turn off automatic updates. Let’s dive right into WordPress automatic updates.

The different types of automatic WordPress background updates

In WordPress there are four different types of automatic background updates:

  • Core updates (WordPress itself),
  • Plugin updates,
  • Theme updates,
  • Translation file updates.

The core updates consist of the following:

  • Core development updates that are only available to development installations.
  • Minor core updates: these are maintenance and security updates. These are enabled by default.
  • Major core updates: these include new features and functionality. For example when upgrading from 5.3 to 5.4

Configuring and controlling WordPress automatic updates

There are a number of wp-config.php file constants that you can use to configure WordPress automatic updates.

Disabling all WordPress background updates

Set the constant AUTOMATIC_UPDATER_DISABLED to disable all of the WordPress automatic background updates. Below is the line you should add to your WordPress wp-config.php file:

define( 'AUTOMATIC_UPDATER_DISABLED', true );

Controlling WordPress core automatic updates

Use the wp-config.php constant WP_AUTO_UPDATE_CORE to control and specify which core updates you want to have automatically installed. Below are some examples.

Enabling all WordPress core updates

# Enables all core updates (minor, major, dev)
define( 'WP_AUTO_UPDATE_CORE', true );

Enabling only WordPress major core updates

# Enables major version updates only
define( 'WP_AUTO_UPDATE_CORE', major );

Enabling only WordPress minor core updates (default behaviour)

# Enables minor version updates only
define( 'WP_AUTO_UPDATE_CORE', minor );

Disabling all WordPress core updates

# Disables all core updates
define( 'WP_AUTO_UPDATE_CORE', false );

Note: It is not recommended to disable WordPress automatic updates. However you might need to in specific scenarios. For example:

  • the WordPress website files are managed via a version control system,
  • it is a testing or development website,
  • WordPress is customized and is running on multiple servers,
  • You are confident you can push WordPress update in a timely fashion.

Filtering the WordPress automatic updates

When you enable all the WordPress core automatic updates your website will be updated with development (nightly builds), minor and major updates. Use filters to selectively enable or disable any of them, as shown in the below examples.

Filter for automatic development updates (nightly builds)

Add the below filter to your site’s plugin or theme’s functions.php to disable auto updating to WordPress core development updates (nightly builds):

add_filter( 'allow_dev_auto_core_updates', '__return_false' );

Delete the above line to enable again development updates or change ‘__return_false’ to ‘__return_true’.

Filter for minor versions automatic updates

Add the below filter to your site’s plugin or theme’s functions.php to disable auto updating to minor version updates :

add_filter('allow_minor_auto_core_updates', '__return_false' );

Delete the above line to enable again minor version updates or change ‘__return_false’ to ‘__return_true’.

Filter for automatic WordPress major updates

Add the below filter to your site’s plugin or theme’s functions.php to disable auto updating to WordPress major version updates:

add_filter('allow_major_auto_core_updates', '__return_false' );

Delete the above line to enable again major version updates or change ‘__return_false’ to ‘__return_true’.

Configuring WordPress automatic updates for plugins and themes

By default the auto updates for WordPress plugins and themes are disabled. You can use filters in your site’s plugin or functions.php to enable them, as explained below.

Enabling automatic background updates for WordPress plugins

Add the following filter in your site’s plugin or functions.php file to enable automatic WordPress plugins updates:

add_filter( 'auto_update_plugin', '__return_true' );

Change ‘__return_true’ to ‘__return_false’ to specifically disable automatic updates of WordPress plugins.

Enabling automatic background updates for WordPress themes

Add the following filter in your site’s plugin or functions.php file to enable automatic WordPress themes updates:

add_filter( 'auto_update_theme', '__return_true' );

Change ‘__return_true’ to ‘__return_false’ to specifically disable automatic updates of WordPress themes.

Enable WordPress automatic updates and also…

WordPress automatic updates are great. They allow you keep your WordPress core, plugins and themes up to date automatically, thus saving you a lot of time. However, when you enable WordPress automatic background updates  you should also:

WordPress Hosting, Firewall and Backup

This Website is:

5 comments

Adam 13/11/2013

Thanks for the solid reference! It was nice to find all of these rules together.

santosh kumar 06/01/2015

there is a plugin update in my blog the below are my configuration but the plugin is not automatically updating
in wp-config.php
define( ‘WP_AUTO_UPDATE_CORE’, false );
adding filters in site specific plugin
add_filter( ‘auto_update_plugin’, ‘__return_true’ );
add_filter( ‘auto_update_theme’, ‘__return_true’ );
add_filter(‘allow_minor_auto_core_updates’, ‘__return_true’ );
add_filter( ‘allow_dev_auto_core_updates’, ‘__return_false’ );
add_filter( ‘allow_major_auto_core_updates’, ‘__return_true’ );
But the plugin isn’t updating why ?

Robert Abela 07/01/2015

Hi Santosh,

The directives look good. Just important to note that these directives only work for plugins and themes downloaded from the WordPress repository. If the plugin is not downloaded from the WordPress repository the automatic updates will not work.

Can you please specify which is the plugin?

santosh kumar 23/01/2015

The plugin to be updated is Jetpack and of course it is from wordpress repository but why it is not updated.Is there any other reason?

Robert Abela 25/01/2015

Hi Santosh,

I am not so familiar with Jetpack. Do any other plugins auto update? If they do, and the problem is only specific to Jetpack I would recommend you to post a support ticket on their plugin page.

Leave a Reply

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