Website Security Headers Basics: What They Are and Which Ones to Add
A short list of useful HTTP security headers, what each does and how to test them without breaking the site.
Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
Security headers are instructions your server sends to browsers.
A practical starter set
- X-Content-Type-Options: nosniff stops browsers guessing file types.
- Referrer-Policy: strict-origin-when-cross-origin limits what is shared when visitors click away.
- Strict-Transport-Security forces HTTPS. See our HSTS guide.
- Frame protection with
X-Frame-Optionsorframe-ancestors. See our iframe guide. - Permissions-Policy to switch off browser features you do not use.
- Content-Security-Policy is powerful but easy to get wrong. Start in report-only mode.
How to add them
Through your host's panel, .htaccess on Apache, a security plugin or your CDN.
Test
Use a free header scanner after each change, then check forms, payments and embeds still work.
Remember
Headers add a layer, but updates and strong passwords matter more. See our security checklist.
Free tool for this problem: .htaccess Generator
Related guides
- WordPress Login Page Keeps Reloading or Redirecting (Can't Log In)
- WordPress User Roles Explained: Administrator, Editor, Author, Contributor, Subscriber
- Unknown Administrator Users Appeared in WordPress: What to Do
- Lost Your Phone or Two-Factor Code for WordPress: How to Get Back In
Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.