Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

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.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Security
  • Tested with WordPress 7.1
PHP
<?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

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.