Skip to content

Instantly share code, notes, and snippets.

@cdevroe
Created April 28, 2026 10:47
Show Gist options
  • Select an option

  • Save cdevroe/2becd5b73b1581d1c04eff5e071b6494 to your computer and use it in GitHub Desktop.

Select an option

Save cdevroe/2becd5b73b1581d1c04eff5e071b6494 to your computer and use it in GitHub Desktop.
Disable Hubbub Save This from sending email
<?php
/**
* Disable the Hubbub "Save This" recipe email.
* Subscribers are still added to the connected Kit form/group, so the Kit
* welcome sequence (and Kit's double opt-in, if enabled) will run normally.
*
* Add via Code Snippets, WPCode, or a child theme's functions.php.
*/
add_filter( 'wp_mail', function( $args ) {
if ( empty( $args['headers'] ) || ! is_array( $args['headers'] ) ) {
return $args;
}
// Hubbub sets headers[2] to "Hubbub: Save This form submission" on Save This emails.
if ( isset( $args['headers'][2] ) && strpos( $args['headers'][2], 'Hubbub: Save This form submission' ) !== false ) {
// Blank out recipients so the email is not delivered.
$args['to'] = array();
$args['subject'] = '';
$args['message'] = '';
}
return $args;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment