Security headers
HTTP security headers explained
What security headers are
Every time a browser asks for a page, the server sends back the page along with a set of HTTP headers: lines of information that visitors never see. Some of them tell the browser how to behave: only use an encrypted connection, don't let another site embed this page, don't run scripts from unknown places.
These settings don't harden your server. They ask the browser to protect your visitors, which is why they mostly limit the damage from certain kinds of attack rather than preventing a break-in. They're also among the few security settings anybody can read from outside, which is why our checker can report on them.
The five protections we check
Strict-Transport-Security (HSTS)
Tells browsers to use only HTTPS for your site for a set period, so nobody can quietly downgrade a visitor to an unencrypted connection. We only look for it on HTTPS responses. A max-age of at least six months (15552000 seconds) counts as good. A shorter or invalid value is flagged for attention, and so is a missing header. Read more in HSTS explained.
Strict-Transport-Security: max-age=31536000Content-Security-Policy (CSP)
Lists where scripts, styles, images and other resources may load from, so an injected script from elsewhere is refused. If your site sends an enforced policy, we report it as set. We don't grade what the policy says, so a weak policy still shows as set. A policy sent only as Content-Security-Policy-Report-Only is flagged, because it watches without blocking. See our Content Security Policy guide.
X-Content-Type-Options
Stops browsers guessing what kind of file they've received. Without it, a file uploaded as harmless text could in some circumstances be treated as something that runs. There's only one useful value, and we look for it. It's among the easiest headers to add.
X-Content-Type-Options: nosniffReferrer-Policy
Controls how much of your page's address is passed on when someone follows a link to another site. That matters if your addresses ever contain something private, such as an order number or a reset token. Any value counts as set except unsafe-url, which we flag because it sends the full address everywhere, even from HTTPS to HTTP. A missing header is only noted for information, because current browsers already default to something reasonably private.
Referrer-Policy: strict-origin-when-cross-originClickjacking protection
Clickjacking means showing your page in an invisible frame on another site, so a visitor thinks they're clicking one thing and actually clicks a button on your site. You can prevent it in two ways, and we accept either: X-Frame-Options set to DENY or SAMEORIGIN, or a frame-ancestors rule in an enforced Content Security Policy. The old ALLOW-FROM form of X-Frame-Options doesn't count, because current browsers ignore it.
X-Frame-Options: SAMEORIGINHeaders we don't report on
There are other useful headers, including Permissions-Policy and the Cross-Origin-* family. Our checker doesn't assess them, so a clean result says nothing about them either way. You may also see advice to add X-XSS-Protection. Modern browsers no longer have the filter it controlled, so it isn't worth adding, and we don't look for it.
What a missing header does and doesn't mean
A missing header is a configuration recommendation. It isn't a sign that your website has been hacked, and many perfectly safe websites lack several of them. Equally, a full set of headers doesn't make a site secure: they do nothing about an out-of-date plugin or a weak administrator password. If you're worried about those things, start with what to check if your website has been hacked.
Our checker only reads the response from your home page, so other pages on your site may send different headers. If a firewall challenges our check or your home page returns a server error, we tell you we couldn't verify your headers rather than reporting them as missing.
How to add them
Your host or developer can usually add the simple ones in a few minutes. Where you make the change depends on how your site is hosted. On shared hosting using Apache or LiteSpeed, it's often the .htaccess file (Apache needs mod_headers enabled):
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options "SAMEORIGIN"
Header always set Referrer-Policy "strict-origin-when-cross-origin"On nginx, it's the site's configuration file:
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;One nginx trap: by default, a block with its own add_header lines doesn't inherit those from the level above, so headers can vanish from part of a site. If you use a CDN or a web application firewall, it may also add, remove or replace headers, so always test the live site after a change. We suggest leaving HSTS and Content Security Policy until last, because a mistake with either can stop your site working for visitors.
Common questions
Which security header should I add first?
Can a WordPress plugin add security headers?
Will security headers affect my search rankings?
Run the free check
Check your website now. It's free, needs no account and takes a few seconds. You can read exactly how the check works and what it can't see, or find out more about the Security Checker on hostdada.co.uk.
Check your website now
Free, passive and takes a few seconds. No account needed.
Guides for website owners
- PHP security warning (October 2026)What the critical PHP fixes mean for your website.Read guide
- Check your PHP versionIs your PHP version supported? Check it against official data.Read guide
- Find your PHP version in WordPressStep-by-step, with or without dashboard access.Read guide
- WordPress security checkerWhat we can (and can't) see about WordPress sites.Read guide
- How the check worksEvery check explained, plus its limitations.Read guide
- Content Security PolicyHow to read a policy and roll one out safely.Read guide
- HSTS explainedWhat a redirect can't do, and how to enable HSTS safely.Read guide
- SSL certificate checkValidity, expiry and what certificate errors mean.Read guide
- X-Powered-By and version leaksWhat your site gives away, and how to remove it.Read guide
- Website hacked? What to checkThe signs, the first hour and a proper clean-up.Read guide