Remove email from ALL wordpress emails

//test to remove my email from ALL outgoing emails
add_filter( "wp_mail", "remove_my_email" );

function remove_my_email( $mail_info ){
//remove from array
if( is_array( $mail_info["to"] ) ){
unset( $mail_info["to"][ array_search( "[email protected]", $mail_info["to"] ) ] );
}
//remove from string
else{
$mail_info["to"] = str_replace( "[email protected]", "", $mail_info["to"] );
}
return $mail_info;
}

1 Comment

You must be logged in to post a comment.


  1. You rule Kprow!