Remove server response header

Question

I’m fairly new to WP/PHP and I’m trying to remove the server response header in functions.php. I’ve been trying use something like this but it doesn’t work:

add_filter('wp_headers', function($headers) {

unset($headers['server']);

return $headers;

});

Not sure what I’m doing wrong.

Thanks

0
Burns 1 month 0 Answers 4 views 0

Leave an answer