Website hardening explained: building layers of defence

What is website hardening? It is the practice of reducing the ways an attacker can reach or abuse your site by tightening many small settings, rather than relying on any single one. It is sometimes called defence-in-depth: if one layer fails, the next still protects you.

Explainer6 min read

No website is ever finished being secured, but most of the high-value steps are well understood and quick to apply. Many of them live in your encryption, your HTTP response headers, your DNS records and your email setup.

This page is a hub. It explains each layer in plain English and points you to the specific fix guides, so you can work through them one at a time.

What hardening actually means

Hardening is the opposite of leaving defaults in place. A fresh website, server or content management system tends to ship with settings chosen for easy setup, not for safety. Hardening means going through those settings and closing the gaps an attacker would otherwise walk through.

The goal is not one perfect wall. It is several modest walls, each cheap on its own, so a single missing setting does not hand someone the keys.

  • Encryption so traffic cannot be read or tampered with in transit
  • Browser instructions (headers) that block common attacks like clickjacking
  • Hiding software versions so you are not an obvious target
  • DNS and email records that stop your domain being spoofed
  • Removing files that should never be public

The core layers of website hardening

Most practical hardening falls into a handful of areas. You do not need to be technical to understand what each is for, even if your developer or host applies the change. Each layer below has its own fix guide.

  • Encryption: serve everything over HTTPS, keep a valid certificate from a trusted authority, redirect http to https, and turn off outdated TLS 1.0 and 1.1.
  • Security headers: add HSTS, a Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Permissions-Policy so browsers enforce safer behaviour.
  • Cookies: mark homepage cookies as Secure, HttpOnly and SameSite.
  • Version hiding: stop your server banner, X-Powered-By, PHP version and (on WordPress) the core version and readme leaking what you run.
  • DNS hardening: add DNSSEC and a CAA record so your domain and certificates are harder to hijack.
  • Email anti-spoofing: publish SPF, DMARC (with an enforced policy, not just p=none) and MTA-STS so others cannot send mail as you.

Why layers beat a single fix

Attackers rarely need one big flaw. They chain small oversights together: an exposed version reveals what to target, a missing header lets a script run, a weak cookie lets it persist. Hardening breaks those chains.

This is also why a scoring tool weights issues differently. A critical problem, such as no working HTTPS, an exposed secret or an untrusted certificate, is a serious gap on its own. A single missing hardening header is a nudge, not a disaster. You want both fixed, but they are not the same weight.

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 free

Plain-English A to E grade in about 10 seconds. No account needed to see it.

How the free EB Security check fits in

Our free check is a fast first signal across every layer above. It reads only what your site already serves publicly: HTTP responses and headers, the TLS certificate, public DNS and a small set of well-known paths. It then returns a 0 to 100 score and an A+ to F grade in about ten seconds, with a plain-English fix for each finding.

It is an external, passive check. It does not log in, brute-force, fuzz or exploit anything, and it is not a penetration test. Use it to see which layers are weak, then work through the matching fix guides. No account is needed to see your grade, and weekly monitoring is available from £9.99 a month.

What an external check cannot harden for you

External checks see the outside of your site, not the inside. There are real layers our check cannot reach, and being honest about them matters. For those, harden separately and treat the free grade as one useful input among several.

  • Malware in your files: our signal is external reputation (Spamhaus, SpamCop and Barracuda blocklists, plus a Google Safe Browsing reputation lookup when configured) and a few exposed-path checks. A clean external result does not prove your files are clean, so run a server-side scanner or ask your host.
  • Plugin and theme vulnerabilities: we check WordPress core version, readme exposure, xmlrpc and username enumeration only, never your installed add-ons. Keep plugins and themes updated and audited yourself.
  • Passwords, admin access and backups: strong credentials, limited admin accounts and tested backups are core hardening too, and sit outside any external scan.

Website hardening is layered defence: fix HTTPS, headers, cookies, version leaks, DNS and email anti-spoofing one step at a time. The free EB check shows which layers are weak in about ten seconds, but pair it with a server-side scan and good password and backup habits for the parts an external check cannot see.

Common questions

What is website hardening in simple terms?
It is tightening many small settings so your site is harder to attack: turning on proper HTTPS, adding security headers, hiding software versions, fixing DNS and email records, and removing files that should not be public. No single change makes you safe, but together they remove the easy ways in.
Is website hardening the same as installing a security plugin?
No. A plugin is one tool that helps with some layers. Hardening is the wider habit of closing gaps across encryption, headers, cookies, DNS and email, some of which live at your host or DNS provider rather than inside your site. A plugin can help, but it does not cover everything.
How do I know which hardening steps my site is missing?
Run a passive external check. The free EB Security scan reads your public HTTP headers, TLS certificate, DNS and a few well-known paths, then grades each layer A+ to F with a plain-English fix. It is a fast first signal, not a full audit, so treat the results as a prioritised to-do list.
Does hardening protect my site from malware?
Partly. Good hardening removes many ways malware gets in, but an external check cannot scan your server files. Our malware signal is reputation (blocklists and a Google Safe Browsing lookup when configured) plus a few exposed-file checks, so a clean result is reassuring but not proof. For that, use a server-side scanner or ask your host.
Can I harden a WordPress site myself?
Many steps, yes: enforcing HTTPS, adding headers, hiding the version, and publishing SPF, DMARC and MTA-STS records. Some need your host or DNS provider. Our check flags WordPress core version, readme exposure, xmlrpc and username enumeration, but not plugin or theme flaws, so keep those updated separately.
Is a passive hardening check a penetration test?
No. A passive check only reads what your site already serves and never logs in, brute-forces, fuzzes or exploits anything. It is a quick health signal across the common layers. A penetration test is a deeper, active engagement by a specialist, and is a sensible next step for higher-risk sites.

How safe is your website?

A free A to E grade in about 10 seconds. No account needed.

Check my site