Skip to content
Oasis Web Services

Security · 9 min read

Website Security Headers: The 6 Basics Explained

Oasis Web Services

A browser window listing six security rules with ticks, a shield with a padlock beside it and a magnifying glass checking the list

I checked the tech companies first

Lately I've had tech companies reach out to me on LinkedIn, offering to help with websites, security and IT. Before I reply to anyone, I like to look at their own website. So I ran a free security header check on a couple of them. One was missing all six of the headers in this guide. The other was missing five, including Strict-Transport-Security, which I'd put near the top of the list.

I'm not naming anyone, and this isn't about pointing fingers. But it did make me stop and think. These are basics that take minutes to set up. If a company selling tech services can't get them right on its own shop window, how is a small business supposed to trust it to build them a secure website, or secure anything else?

So here's my advice before you hire anyone, us included: check their site first. This guide shows you how.

Think of your website as a shop

Your developer fitted the locks. Security headers are the rule cards you hand every customer on the way in: "Use the front door only." "No stickers on the windows." "Cameras off in the changing rooms." The shop trades fine without them. But a browser is an obedient customer, and it follows whatever rules you give it. Give it none, and it falls back on its defaults.

This guide explains the six headers without jargon, shows you how to check yours, and tells you what to ask your developer.

What are website security headers?

Website security headers are short instructions that your web server sends to a visitor's browser, telling it which safety rules to apply to your pages. Visitors never see them. They travel quietly alongside the page itself.

The OWASP project (a respected non-profit for web security) says proper response headers can help prevent problems such as cross-site scripting, clickjacking and information disclosure (OWASP HTTP Headers Cheat Sheet (opens in a new tab)). Cross-site scripting means an attacker sneaking their own code into your page. Clickjacking means tricking someone into clicking something hidden. Both get a plain-English explanation below.

Two things worth knowing. Headers are a safety net, not a force field, so they don't replace keeping your site and plugins up to date. And they're set on the server or host, not in your page design, so a designer can build a lovely site and never see them.

The six main security headers, in plain English

Here are the six, with what each one stops.

Strict-Transport-Security

It stops anyone pushing your visitors onto the unprotected "http" version of your site. OWASP describes it as telling browsers to use HTTPS only, even if someone tries to connect the old way (OWASP (opens in a new tab)). HTTPS is the padlock version of a website. Without this header, the padlock is a habit rather than a rule.

X-Content-Type-Options

It stops a browser guessing what a file is and running it as something else. The single setting, "nosniff", tells the browser to trust the label on the box (MDN (opens in a new tab)). It's one line, and about as quick a win as security gets.

Referrer-Policy

It controls how much of your page address gets passed to the next site when someone clicks a link or loads something from elsewhere. Current versions of the main browsers already apply a sensible default, called strict-origin-when-cross-origin (Can I use (opens in a new tab)), and web.dev suggests setting it yourself (web.dev (opens in a new tab)). So this is the lowest-drama header on the list. Setting it just removes the guesswork.

X-Frame-Options

It stops other websites from showing your pages inside a hidden frame to trick visitors into clicking (that's clickjacking). MDN says the newer "frame-ancestors" setting inside Content-Security-Policy is its replacement, and browsers that understand it ignore X-Frame-Options (MDN (opens in a new tab)). Plenty of sites send both so older browsers are covered too.

Permissions-Policy

It stops your pages, and anything embedded in them, from using browser features such as the camera, microphone or location unless you've said that's fine. MDN's example is blocking geolocation with a single short line (MDN (opens in a new tab)). If your site never needs the camera, there's no good reason to leave it available.

Content-Security-Policy

It stops code you haven't approved from running on your pages, by listing the places your site is allowed to load things from. MDN says its main target is cross-site scripting (MDN (opens in a new tab)). It's also the most powerful of the six and the fiddliest, because it has to know about every script, font and widget your site uses. Get it wrong and something stops working. MDN advises testing a policy in "report-only" mode first, where it reports problems without blocking anything.

How common are missing security headers?

Very common, even among popular sites. The HTTP Archive's Web Almanac 2025 found Strict-Transport-Security on 36% of mobile pages and Content-Security-Policy on 21.9%. It put Permissions-Policy at just 3.7% (Web Almanac, 2025 (opens in a new tab)). X-Content-Type-Options led the pack at nearly 50%.

Researcher Scott Helme's June 2026 crawl of the top million sites tells a similar story. Of the 819,002 sites that responded, 170,057 sent Content-Security-Policy and 101,364 sent Permissions-Policy (Scott Helme, 2026 (opens in a new tab)). By our own sums from his published counts, that's about one in five and one in eight. None of the six headers reached half of the sites he measured.

The samples differ, so don't compare the numbers directly. The message is the same, though. If your site is missing some of these, you're in the majority. That's comforting, but it's not a reason to leave them off. And if you sell tech services, it's definitely not a good look.

How to check your website's security headers for free

Paste your web address into a free scanner and read the result. It takes about a minute. Here's how.

  1. Open the MDN HTTP Observatory (opens in a new tab), a free scanner run by MDN, and type in your domain.
  2. Or try SecurityHeaders.com (opens in a new tab), which Scott Helme created and has said remains free to use (Scott Helme (opens in a new tab)). It grades headers from A+ to F (The Register, 2016 (opens in a new tab)).
  3. Look for the six header names in the results and note which ones are missing.
  4. Save or screenshot the result, so you have a before-and-after for your developer.

Two cautions. MDN says anyone can scan any domain on its tool and each domain's scan history is public (MDN (opens in a new tab)), so keep that in mind before you scan. And if your grade looks oddly dreadful, the scan may have hit a firewall or a broken page. Helme's tool now warns when it thinks a scan was blocked (Scott Helme (opens in a new tab)).

An A+ doesn't mean "unhackable". These tools read your headers, not your whole site.

What to ask your web developer or host to do

Ask them to add the headers at server or host level, test them, and send you a before-and-after scan. Most of the six are a few lines of settings. Content-Security-Policy is the exception, and that's where the real work lives.

Here's a short list you can forward as it is:

  • "Can you add Strict-Transport-Security, X-Content-Type-Options, Referrer-Policy, X-Frame-Options and Permissions-Policy?"
  • "Can you start Content-Security-Policy in report-only mode, so we can see what it would block before it blocks anything?"
  • "Can you begin Strict-Transport-Security with a short lifetime and lengthen it once every page and subdomain is confirmed working on HTTPS?"
  • "Which of our plugins, chat widgets, analytics and payment tools does the policy need to allow?"
  • "Can you send me a scan from before and after, so I can see what changed?"

Our view: the headers themselves are rarely the hard part. The hard part is knowing what your site loads, so the policy doesn't break the checkout. And please, nobody switch on a strict policy on a live shop at 4pm on a Friday.

What security headers won't do

Headers reduce the damage from certain browser-side attacks. They won't patch an out-of-date plugin, stop someone guessing a weak password or protect a site that's already compromised. Think seatbelt, not armour plating. Keep updates, backups and strong logins on your list too. Our web application security guide covers those wider basics.

FAQ

What are website security headers?

They're short instructions your server sends with every page, telling the visitor's browser which safety rules to follow. They help guard against problems such as cross-site scripting and clickjacking. Visitors never see them, but a free online scanner can show you which ones your site sends and which are missing.

How do I check my website's security headers for free?

Enter your domain into a free scanner such as the MDN HTTP Observatory or SecurityHeaders.com. Both list which headers your site sends and which are missing. Save the result and share it with your developer or host. Remember a scan reads your headers only, not your whole site's security.

Which security headers matter most?

Strict-Transport-Security is our first pick, because it keeps visitors on the secure version of your site. X-Content-Type-Options and Referrer-Policy are quick wins. Content-Security-Policy offers the most protection against injected code, but needs the most care, so test it in report-only mode first.

Can security headers break my website?

Yes, mainly Content-Security-Policy. If it blocks a script, font or widget your site relies on, that feature stops working. MDN recommends trying a policy in report-only mode first, which logs problems without blocking anything. Strict-Transport-Security also needs care if some pages can't run on HTTPS.

Does a missing header mean my site has been hacked?

No. A missing header means a safety rule isn't set, not that anyone has broken in. Think of it as an unlocked window rather than a burglary. It's still worth fixing, because headers reduce the harm if something else goes wrong. Fixing them takes minutes for most sites.

How we can help

We set all six on our own site. If you'd like a second pair of eyes on yours, we can check your headers and the wider basics, explain what we find in plain English and give you a short, ordered list of fixes. If you'd like us to make the changes, we'll quote for that separately, and our maintenance plan keeps them in place after.

We can't promise a particular grade or that a site will never be attacked. Nobody honest can. What we can do is take the basics off your to-do list.

Get a free quote and we'll take a look.

Sources