Created
April 28, 2026 10:47
-
-
Save cdevroe/2becd5b73b1581d1c04eff5e071b6494 to your computer and use it in GitHub Desktop.
Disable Hubbub Save This from sending email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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