Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

WordPress 3.7 added automatic updates. How does this work, and how can I configure this feature?

share|improve this question

2 Answers 2

up vote 21 down vote accepted

Automatic updates are automatic.

The basic, default behavior in WordPress 3.7 is automatic update of core for minor versions (i.e. X.Y.Z to X.Y.Z+1.)

No configuration options are exposed in the UI. To change the behavior, you'll need to modify your wp-config.php file, or add some filters:

Easy Disabling

Add the following to wp_config.php:

define( 'AUTOMATIC_UPDATER_DISABLED', true );

Alternatively, add the following filter:

add_filter( 'automatic_updater_disabled', '__return_true' );

Core Update Control

Via wp-config.php:

// Update core - development, major, and minor versions
define( 'WP_AUTO_UPDATE_CORE', true );

// Update core - minor versions
define( 'WP_AUTO_UPDATE_CORE', 'minor' );

// Core update disabled
define( 'WP_AUTO_UPDATE_CORE', false );

Via filters:

// Enable nightlies (dev updates):
add_filter( 'allow_dev_auto_core_updates', '__return_true' );

// Enable major version updates:
add_filter( 'allow_major_auto_core_updates', '__return_true' );

// Disable minor updates
add_filter( 'allow_minor_auto_core_updates', '__return_false' );

Themes and Plugins

All-or-Nothing Auto-Update Themes and Plugins:

Theme and Plugin updates are disabled by default. To enable via vilter:

add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );

These filters are passed the update object; so it is possible to manipulate that object to target specific Themes or Plugins to be updated, either to whitelist (include) or exclude from automatic updates.

Translation Files

Translation file updates are enabled by default. To disable via filter:

// Disable translation updates
add_filter( 'auto_update_translation', '__return_false' );

Update Result Emails

The updater sends a result email on success, failure, or critical error. To disable via filter:

// Disable update emails
add_filter( 'auto_core_update_send_email', '__return_false' );

This filter can also be used to manipulate update emails according to email $type (success, fail, critical), update type object $core_update, or $result:

/* @param bool   $send        Whether to send the email. Default true.
 * @param string $type        The type of email to send.
 *                            Can be one of 'success', 'fail', 'critical'.
 * @param object $core_update The update offer that was attempted.
 * @param mixed  $result      The result for the core update. Can be WP_Error.
 */
apply_filters( 'auto_core_update_send_email', true, $type, $core_update, $result );

Further Reading

Codex entry here. More information here.

share|improve this answer
    
Is there a way I can test if my automatic updates are working besides waiting? Also can I exclude certain plugins from the update plugin filter? –  Howdy_McGee Oct 25 '13 at 14:48
5  
I think you can do this for individual theme/plugin update as per Nacin's comments "The previous configuration options are all-or-nothing. You may, however, want something more fine-grained. The auto_update_$type filter (auto_update_core, auto_update_plugin, auto_update_theme, auto_update_translation) is fired for specific updates, as they are ready to be updated. This filter is passed the actual update object that describes what WordPress is about to update. This means you can selectively enable individual plugins or themes to update, for example, or whitelist upcoming core updates." –  pollyplummer Oct 25 '13 at 17:12
1  
@pollyplummer by all means, please add that info to the answer! That's good stuff. :) –  Chip Bennett Oct 25 '13 at 17:17
1  
@brasofilo "In the section "Easy Update", shouldn't it be "Or add the following filter"?" - not according to the Codex. It recommends using both. –  Chip Bennett Oct 25 '13 at 17:52
1  
@Howdy_McGee I just posted a guide for how to exclude certain plugins. Also, the update page in Wordpress tells you if auto updates are enabled. If it doesn't mention auto-updates, then use this plugin to learn why they're disabled. –  David Jan 28 at 3:26

You can check if your site and server configuration support automatic updates with the Background Update Tester plugin. From Nacin: "This plugin checks your site for compatibility and explains any problems."

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.