Remove the X-Mailer Header From Emails
Stops outgoing emails announcing "PHPMailer" and its version in the X-Mailer header, which reveals details about your server and can count against you in spam filters.
Opens WPIDE on
Code
add_action( 'phpmailer_init', function ( $phpmailer ) {
$phpmailer->XMailer = ' ';
} );
Notes
PHPMailer omits the header entirely when it is set to a single space.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.