How to hide the server version and X-Powered-By header on your site
To hide the server version and X-Powered-By header, set ServerTokens Prod in Apache, server_tokens off in Nginx, and expose_php Off in PHP. Those three settings stop your site announcing exactly which software and version it runs on every response.
This is sensible hardening rather than a fix in its own right. Hiding a version number does not patch anything, but it does deny casual scanners a free shortlist of known issues to try against your exact release.
Our free external scan reads your live response headers and flags a server banner, an X-Powered-By value or a published WordPress version when it sees one, so you can confirm what you are leaking before and after you make the change.
What these headers actually leak
Every response your server sends carries headers, and a couple of them tend to say more than they need to. The Server header can read something like Apache/2.4.41 (Ubuntu), and X-Powered-By often reads PHP/7.4.3. WordPress can publish its own version on top.
On their own these values let nobody in. The concern is that a precise version string lets an attacker, or an automated scanner, match your software against published issues for that exact release without probing anything themselves.
- Server: the web server name, often its full version and the operating system
- X-Powered-By: usually the PHP version, sometimes a framework or hosting platform
- WordPress version: published in page source, a generator meta tag or readme.html
How to hide the version banners (the three settings)
The change is configuration, not code. In each case you are telling the software to stop volunteering its version, then reloading or restarting the service so the new setting takes effect.
Apply the one that matches your stack, then re-test to confirm the banner has gone quiet.
- Apache: set ServerTokens Prod, and ServerSignature Off, in the main config, then reload Apache
- Nginx: set server_tokens off; in the http, server or location block, then reload Nginx
- PHP: set expose_php Off in php.ini to drop the X-Powered-By: PHP header, then restart PHP-FPM
- WordPress: remove the generator tag and delete or block readme.html so the core version is not published
Why this is defence-in-depth, not a cure
Hiding a version number changes nothing about whether that version is actually vulnerable. If you are running end-of-life PHP or an outdated server, the real fix is to update, not to hide the label.
Think of it as removing the signpost. A determined attacker can often still fingerprint your software through its behaviour, so treat suppressed banners as one quiet layer on top of patching, never a substitute for it. The headers you remove cost an attacker a little time; the updates you apply remove the actual risk.
Free, instant, no account
See your site's security grade in seconds.
Free, instant, and no account needed to see your grade.
Scan my site freePlain-English A to E grade in about 10 seconds. No account needed to see it.
How our free check reports a leaked banner
When you run an EB Security scan, we read the headers your site already serves to any visitor and flag information disclosure where the Server banner, an X-Powered-By value or a published WordPress version is visible. The scan is passive and external: no logins, no probing, no exploitation.
This finding sits in the lower-severity, best-practice tier of your report. A leaked banner will nudge your grade and gives you a clear, named thing to tidy up, but it will not sink your score on its own. Critical items, like a broken or untrusted certificate or an exposed secret, are what hard-cap a grade, not a chatty header.
- We read only what is public, exactly as any browser would see it
- The finding comes with a plain-English explanation and the setting to change
- Re-scan after applying ServerTokens Prod, server_tokens off or expose_php Off to confirm it is gone
A sensible order to work through
Suppressing banners is quick, so it is a fine early tidy-up. Just do it alongside the things that genuinely reduce risk, not instead of them.
A practical sequence keeps your effort pointed at what matters most while still closing the easy gaps.
- First, update any end-of-life or outdated PHP, web server or WordPress core that a scan flags
- Then hide the version banners with the three settings above
- Then add the missing security headers, such as HSTS, CSP and X-Content-Type-Options
- Finally, re-run a scan to confirm the changes landed and nothing else regressed
Hiding the server version and X-Powered-By header with ServerTokens Prod, server_tokens off and expose_php Off is quick, sensible hardening: it removes a free shortlist for scanners, but it is no substitute for actually patching outdated software.