Exclude plugins from the Advanced Automatic Updates WordPress plugin

The Advanced Automatic Updates plugin is one of my favorite WordPress plugins, but it lacks a way to easily specify exclusions. I'll show you how to to exclude plugins from being automatically updated by this plugin.

May 26, 2020 update: Advanced Automatic Updates hasn’t been updated for over 2 years, so although it may still work, it would be best to find an actively developed alternative. It looks like the best alternative is Easy Updates Manager. Alternatives are, in order of number of installs, Companion Auto Update, Simple Automatic Updates, WP Auto Updater, and Disable updates, Updates manager, Disable automatic updates.

This post was updated on September 13, 2014, to reflect a change that had occurred in WordPress 3.8.2. Thanks to Ben Wise for pointing it out.

Note: This page contains affiliate links. Please see Affiliate Disclosure.

The Advanced Automatic Updates plugin

Advanced Automatic Updates gives you control over what can be updated with WordPress' automatic updates: Core (major and minor versions), plugins, and themes. It's very important to keep WordPress updated, and this plugin removes a lot of the grunt work.

Advanced Automatic Updates settings

Exclude plugins from automatic updates

One feature that it's lacking is a way to easily specify exclusions. For example, I don't want e-commerce plugins updating automatically. Fortunately, it's pretty easy to specify exclusions in code. Here's an example where I exclude 3 plugins: Espresso Calendar, Event Espresso, and WooCommerce.

/**
* Prevent certain plugins from receiving automatic updates, and auto-update the rest.
* http://wordpress.stackexchange.com/questions/131394/how-do-i-exclude-plugins-from-getting-automatically-updated
*/
function exclude_plugins_from_auto_update ( $update, $item ) {
$plugins = array ( // Plugins to exclude from auto-update
'espresso-calendar/espresso-calendar.php',
'event-espresso/espresso.php',
'woocommerce/woocommerce.php'
);
if ( in_array( $item->plugin, $plugins ) )
return false; // Don't auto-update specified plugins
else return true; // Auto-update all other plugins
}
add_filter( 'auto_update_plugin', 'exclude_plugins_from_auto_update', 10, 2 );

All you need to change in this code is the $plugins array. You want to use the name of the plugin's folder and the name of the plugin's primary PHP file. This is usually fairly obvious, but may take some looking.

You could put this in your functions.php file, but then it's tied to your theme, and you risk losing it if you change themes. It would be better to create a custom plugin. Here's what I did:

  1. In wp-content/plugins, created a folder named optimwise-exclude-updates.
  2. In that folder, created a file named optimwise-exclude-updates.php.
  3. Added plugin info to header.
  4. Pasted code above.

Thanks to the WordPress Answers post How do I exclude plugins from getting automatically updated? for the code! Thanks to Ben Wise for pointing out the change in WordPress 3.8.2 and above.

If you can improve on anything here, please leave a comment.

Filed Under: 

Want tips to rocket-boost your website?

Simply sign up.

10 comments on “Exclude plugins from the Advanced Automatic Updates WordPress plugin”

  1. As of WordPress 3.8.2 at least on our system the parameter $item has changed and is now an object. So you'd need to do something like:

    if ( in_array( $item->plugin, $plugins ) )

    instead of:
    if ( in_array( $item, $plugins ) )

    Hope that helps.

      1. Hi Chad. I can't find any documentation on the parameters to the auto_update_plugin filter in the codex nor any change log documentation, it just started failing and I put some debug code in there and found it had changed to an object.

  2. Thanks for this! I was looking for a way to install Advanced Automatic Upgrades without updating MailPress. One suggestion/question though: wouldn't it be easier to just drop the code you mention in a file in wp-content/mu-plugins rather than creating a custom plugin?

    (Must-use plugins are described here: http://codex.wordpress.org/Must_Use_Plugins)

    Cheers, Graham

  3. Would this also work if I linked it to a single file in a plugin? If I adjusted only the template file of a plugin, I'd be okay with it if the core'd be updated, but I'd like to exclude to exclude the template.php-file. Would this work?

    1. I don't know, Daan, since we never tried that. My guess would be no, since the automatic updates run at the level of core, plugin, or theme, not at the file level. It should be easy to test, though. Please comment again to share your findings.

  4. Long time has passed. What is the scenario today? Is there an easy plugin that manages exclusions for plugin and theme auto-update?

Leave a Reply

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

Ready to Blast Off?

Let's talk.

Contact OptimWise
crossmenuarrow-right