Core headers
5
CSP, HSTS, X-Frame-Options, nosniff and Referrer-Policy
Performance + SEO + UX Intelligence
Security headers tell the browser how to protect your visitors: which scripts may run, whether the site may be framed, and that it must always use HTTPS. Enter a URL to see which headers are missing or too weak, with the exact value to set. Free with a Google sign-in.
Core headers
5
CSP, HSTS, X-Frame-Options, nosniff and Referrer-Policy
HSTS preload
1 year
Minimum max-age of 31536000 seconds
Setup time
Minutes
Most headers are one line of server config
HTTP security headers are instructions your server sends with every page. The browser enforces them, so they protect visitors even when something else goes wrong, such as a script injected through a comment form or a link that tries to load your site inside someone else's frame.
They cost nothing to add and most are a single line in your web server, CDN or framework config. Yet many sites ship without them because nothing visibly breaks when they are missing.
This security headers checker reads the response headers of your page and grades each one. It goes beyond "present or missing": it flags a Content-Security-Policy that still allows unsafe-inline scripts, an HSTS header too short for the preload list, and headers that reveal your server software and version.
A strict Content-Security-Policy is the strongest defence against cross-site scripting (XSS): even if an attacker manages to inject a script tag, the browser refuses to run code from a source you did not allow.
Strict-Transport-Security (HSTS) stops downgrade attacks. Once a browser has seen it, it will only ever connect over HTTPS, so nobody on the same Wi-Fi network can intercept the first plain-HTTP request.
Headers that announce "Apache/2.4.58" or "X-Powered-By: PHP/8.1" do not break anything on their own, but they let automated scanners match your exact version against lists of known vulnerabilities. Hiding them removes an easy shortcut.
Whether a policy exists, whether it is only report-only, and whether it allows unsafe-inline, unsafe-eval or wildcard sources.
The max-age value, includeSubDomains and the preload directive needed for the browser preload list.
X-Frame-Options (clickjacking), X-Content-Type-Options: nosniff and Referrer-Policy.
Server and X-Powered-By version numbers, wildcard CORS with credentials, and cookies missing Secure, HttpOnly or SameSite.
Each finding comes with the recommended value, so you can copy it into your config instead of reading the specification.
Site Vitals loads your page in a real browser and records the response headers of the main document, plus any cookies set while the page loads.
It parses the Content-Security-Policy directive by directive, checks the HSTS max-age against the one-year minimum used by the preload list, and compares the other headers against current recommendations from OWASP and browser vendors.
The header summary appears in the Security section of your report and the deeper checks (CSP strength, HSTS strength, version disclosure, CORS and cookies) in the Server Security section. Both need a free Google sign-in to view in full.
Run the checker on your home page and on one logged-in or checkout page if you have them; headers can differ per route.
Add X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin and X-Frame-Options: SAMEORIGIN. They rarely break anything.
Start with max-age=300, confirm every subdomain works over HTTPS, then raise it to 31536000 and add includeSubDomains.
Send Content-Security-Policy-Report-Only first, collect violations for a week, then switch to the enforcing header.
Set ServerTokens Prod in Apache, server_tokens off in Nginx and expose_php = Off in PHP.
Confirm each header shows as passing and that the site still works in a normal browser session.
Shipping a Content-Security-Policy that includes 'unsafe-inline' for scripts, which removes most of its XSS protection.
Leaving CSP in report-only mode for months, so nothing is actually blocked.
Adding HSTS with preload before checking that every subdomain supports HTTPS.
Setting headers in the application only, so error pages and static files served by the web server go out without them.
Sending "Access-Control-Allow-Origin: *" together with credentials.
These values are a safe starting point for most sites. Content-Security-Policy is the one that needs tailoring to the scripts and styles you load.
| Header | Recommended value | Protects against |
|---|---|---|
| Strict-Transport-Security | max-age=31536000; includeSubDomains | Downgrade to HTTP |
| Content-Security-Policy | Nonce or hash based, object-src 'none' | Cross-site scripting |
| X-Frame-Options | SAMEORIGIN or DENY | Clickjacking |
| X-Content-Type-Options | nosniff | MIME type confusion |
| Referrer-Policy | strict-origin-when-cross-origin | Leaking full URLs |
Set headers at the outermost layer that serves every response, usually the CDN or web server, so static files and error pages are covered too.
Use nonces or hashes for inline scripts instead of 'unsafe-inline'; most frameworks can add a nonce automatically.
Prefer the CSP frame-ancestors directive for framing rules, and keep X-Frame-Options for older browsers.
Re-scan after deploying new third-party scripts; a CSP that was correct last month may now block or allow the wrong sources.
Treat headers as one layer of defence. They do not replace keeping your CMS, plugins and libraries up to date.
At minimum: Strict-Transport-Security, X-Content-Type-Options: nosniff, a framing rule (X-Frame-Options or CSP frame-ancestors) and Referrer-Policy. Add a Content-Security-Policy as soon as you can test it.
Not directly. Google does not rank pages by their headers. They protect your visitors and your reputation; a hacked site that serves spam or malware is what hurts rankings.
No. Modern browsers have removed the filter it controlled, and in old browsers it could introduce problems. Set it to 0 or leave it out, and rely on Content-Security-Policy.
Speed and SEO results are open to everyone without an account. The other report sections, including security headers, need a free Google sign-in. Once you are signed in, every report you run shows in full.
It can if the policy misses a source you use. That is why the safe path is to start with Content-Security-Policy-Report-Only, fix what it reports, then enforce it.
A handful of response headers block whole classes of attacks for every visitor, and most take a single line to add. Checking them takes a minute.
Run the security headers checker after server moves, CDN changes and new third-party integrations, since those are the moments headers quietly disappear.
Find missing or weak CSP, HSTS and framing headers, plus version leaks and insecure cookies, with the exact value to set.