Don’t announce the PHP version
Removes the X-Powered-By header that tells every visitor (and every scanner) which PHP version the server runs.
<?php
add_action(
'send_headers',
static function () {
if ( function_exists( 'header_remove' ) ) {
header_remove( 'X-Powered-By' );
}
}
);
Good to know
Covers pages WordPress builds. Setting expose_php = Off in php.ini covers everything.
In these packs
- Login and security extras: Limit login attempts, email-only logins, a registration spam trap and more hardening.