Disable WordPress Auto-Update Emails, Keep Failure Alerts

WordPress sends an email after every automatic update, for core, plugins and themes. With auto-updates turned on across several sites, those emails turn into noise, and the ones that matter, failed updates, get lost among them.

This snippet disables the routine success emails and keeps the ones that need action: a failed or critical core update, and any plugin or theme update run where something did not install.

The snippet

<?php
add_filter( 'auto_core_update_send_email', 'dpc_core_update_email_on_failure_only', 10, 2 );

/**
 * Skip the "your site has updated" email, keep failure and critical emails.
 */
function dpc_core_update_email_on_failure_only( $send, $type ) {
	if ( 'success' === $type ) {
		return false;
	}

	return $send;
}

add_filter( 'auto_plugin_update_send_email', 'dpc_extension_update_email_on_failure_only', 10, 2 );
add_filter( 'auto_theme_update_send_email', 'dpc_extension_update_email_on_failure_only', 10, 2 );

/**
 * Send the plugin or theme update email only when at least one update failed.
 */
function dpc_extension_update_email_on_failure_only( $enabled, $update_results ) {
	foreach ( (array) $update_results as $result ) {
		if ( isset( $result->result ) && true !== $result->result ) {
			return $enabled;
		}
	}

	return false;
}

Add it with Scripts Organizer

Scripts Organizer ships this snippet in its One-Click Import library. To add it by hand:

  • In wp-admin go to Scripts Organizer → Code Blocks → Add New and give the block a title.
  • Script location: PHP.
  • Trigger location: Everywhere. Automatic updates run from WP-Cron, which is neither a wp-admin screen nor a normal front-end page view, so Admin only and Conditions would miss it.
  • Action hook: leave it empty. The code only registers filters and actions, so it can run while plugins load.
  • Paste the snippet into the PHP editor, enable the block and publish it.

The same code also works unchanged in a small plugin or an mu-plugin file in wp-content/mu-plugins/.

How it works

  • auto_core_update_send_email receives the email type: success, fail or critical. The snippet returns false only for success. Emails about a manual update do not go through this filter at all.
  • auto_plugin_update_send_email and auto_theme_update_send_email receive the results of one update run. Each result has a result property that is true when that update worked. If every result is true, the email is dropped. If any update failed, the normal email goes out and lists the successes and failures together.
  • Older copies of this snippet returned false on all three filters, which also silenced failure and critical emails, the ones you want to see.

Customise it

To silence plugin and theme emails completely and keep only core failure emails, replace the two plugin and theme add_filter() lines with these:

add_filter( 'auto_plugin_update_send_email', '__return_false' );
add_filter( 'auto_theme_update_send_email', '__return_false' );

To send update emails to another address than the site admin, filter auto_core_update_email and auto_plugin_theme_update_email. Both receive the email as an array with a to key.

Gotchas

In the Scripts Organizer library Import it with one click from Scripts Organizer.

// newsletter

Three tested WordPress snippets a week

Blocks, security, performance, Tailwind, PHP and React. Copy, paste, ship. You’ll also get DPlugins product updates. No spam, and you can unsubscribe anytime.

// newsletter

Three tested WordPress snippets a week

Blocks, security, performance, Tailwind, PHP and React. Copy, paste, ship. You'll also get DPlugins product updates. No spam, and you can unsubscribe anytime.