Halloween Sale 15% off Ends in See the plans
PHP

Send Automatic Update Emails to Your Developer

Sends WordPress core, plugin and theme auto-update emails to your developer or agency instead of the site owner, who usually does not need them.

Don’t have WPIDE yet? Install it on your site

Code

$wpide_update_recipients = array(); // e.g. array( '[email protected]' ); empty = no change.

$wpide_update_to = function ( $email ) use ( $wpide_update_recipients ) {
    $to = array_values( array_filter( $wpide_update_recipients, 'is_email' ) );

    if ( $to ) {
        $email['to'] = $to;
    }

    return $email;
};

add_filter( 'auto_core_update_email', $wpide_update_to );
add_filter( 'auto_plugin_theme_update_email', $wpide_update_to );
add_filter( 'automatic_updates_debug_email', $wpide_update_to );

Notes

Add one or more addresses at the top; once set, the site owner stops receiving these emails.

How to add this snippet

  1. Install WPIDE on your WordPress site (it is free) and open Code Snippets.
  2. Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
  3. It is added inactive: review the code and settings, then switch it on.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.

Which site should get this snippet?

Enter the address of your WordPress site. WPIDE opens there in a new tab with the snippet ready to review and save.

Remembered in this browser only, so you are asked once.

Report this snippet

Tell the WPIDE team what is wrong: broken code, something harmful, spam or copied work.