Security Headers Every Website Should Have
A few lines of server configuration that block whole classes of attacks. Here is what each one does.
Security headers are instructions your server sends with every page. They tell the browser how to behave and switch on built-in protections. They are quick to add and free.
The essential headers
- Strict-Transport-Security (HSTS): forces browsers to always use HTTPS on your site
- Content-Security-Policy (CSP): lists which scripts and resources may load, which blocks most XSS attacks
- X-Frame-Options: stops other sites from loading yours in a hidden frame (clickjacking)
- X-Content-Type-Options: nosniff: stops browsers from guessing file types in dangerous ways
- Referrer-Policy: controls how much of your page address is shared with other sites
- Permissions-Policy: turns off features you don’t use, such as camera or microphone
How to check yours
Free scanners like securityheaders.com grade your site in seconds. Headers can be added in your server settings, .htaccess file, Cloudflare or a security plugin.
Security headers cost nothing and close common gaps. Check your grade today.