---
title: "HTTP security headers"
description: "HSTS, CSP, X-Frame-Options, nosniff, Referrer-Policy: the role of each HTTP security header, the ones to remove and where to set them on WordPress."
language: "en"
locale: "en-US"
type: "definition"
canonical: "https://www.wp-feint.com/glossary/http-security-headers/"
published: "2026-10-28T08:00:00+00:00"
modified: "2026-11-22T12:07:16+00:00"
translations:
  en-US: "https://www.wp-feint.com/glossary/http-security-headers/index.md"
  fr-FR: "https://www.wp-feint.com/fr/definitions/en-tetes-securite-http/index.md"
  es-ES: "https://www.wp-feint.com/es/glosario/cabeceras-de-seguridad-http/index.md"
  de-DE: "https://www.wp-feint.com/de/glossar/http-sicherheitsheader/index.md"
  it-IT: "https://www.wp-feint.com/it/glossario/header-sicurezza-http/index.md"
  pt-BR: "https://www.wp-feint.com/pt/glossario/cabecalhos-de-seguranca-http/index.md"
  nl-NL: "https://www.wp-feint.com/nl/woordenlijst/http-beveiligingsheaders/index.md"
---

# HTTP security headers

HTTP security headers are instructions the server sends with every page and the browser enforces: forcing HTTPS, forbidding display in an external frame, limiting allowed scripts or the information passed along. They protect visitors without fixing vulnerabilities in the site itself.

Every response from a web server starts with headers the visitor never sees: content type, caching, cookies. Some of them exist only for security. They don't fix any vulnerability on the site, but they ask the browser to refuse risky behavior: displaying the page inside another site's frame, guessing a file's type, loading an unknown script or falling back to HTTP. The protection therefore applies to visitors and to how your pages are rendered for them.

## The main security headers

| Header | Role | Typical value |
| --- | --- | --- |
| `Strict-Transport-Security` | Forces HTTPS on later visits | `max-age=31536000` |
| `Content-Security-Policy` | Lists allowed sources of scripts, styles and frames | Built site by site |
| `X-Frame-Options` | Forbids display in an external frame | `SAMEORIGIN` or `DENY` |
| `X-Content-Type-Options` | Stops the browser from guessing a file's type | `nosniff` |
| `Referrer-Policy` | Limits the URL passed to linked sites | `strict-origin-when-cross-origin` |
| `Permissions-Policy` | Turns off sensitive browser APIs | `camera=(), microphone=(), geolocation=()` |

Two of them deserve their own definition: [HSTS](https://www.wp-feint.com/glossary/hsts/), which locks in HTTPS, and [Content Security Policy](https://www.wp-feint.com/glossary/content-security-policy/), the most effective header against [cross-site scripting (XSS)](https://www.wp-feint.com/glossary/xss/) but also the trickiest to configure. `X-Frame-Options` and the CSP `frame-ancestors` directive protect against [clickjacking](https://www.wp-feint.com/glossary/clickjacking/).

![Three-column table: headers with a low risk of breakage (nosniff, X-Frame-Options, Referrer-Policy, Permissions-Policy), headers to test first (HSTS and CSP, in report-only mode then in steps), headers to stop sending (X-XSS-Protection, Expect-CT, Feature-Policy, X-Powered-By)](https://www.wp-feint.com/media/2026/10/en-tetes-securite-carte-en.webp)

## Headers to stop sending

The OWASP HTTP Headers Cheat Sheet advises against `X-XSS-Protection`, which can create vulnerabilities on otherwise safe sites (omit it or set it to `0`), and `Expect-CT`, which should be removed. `Feature-Policy` has been replaced by `Permissions-Policy`. Conversely, OWASP recommends removing `X-Powered-By` and making `Server` less talkative: these headers announce the PHP or server version and make [fingerprinting](https://www.wp-feint.com/glossary/fingerprinting/) easier.

*Video: “HTTP Security Headers Explained - What are security headers and how do I implement them?” (Halo Security)*

## For WordPress

WordPress already sends `X-Frame-Options: SAMEORIGIN` and `frame-ancestors 'self'` on the admin area and the login page, through the `send_frame_options_header()` function. Public pages, however, get none of these headers by default. There are three places to add them:

- **The server**: `Header always set` in an Apache or LiteSpeed `.htaccess` file, `add_header … always` in Nginx. This is the most complete solution, because it also covers static files and cached pages.
- **The CDN**: response transform rules, handy if the site sits behind a proxy.
- **PHP or a plugin**: the `send_headers` action, useful without access to the configuration, but missing from responses that don't go through WordPress.

Then check the result with `curl -I https://your-site.com/` or the browser's Network tab, after clearing caches. Our guide to [HTTP security headers for WordPress](https://www.wp-feint.com/http-security-headers-wordpress/) gives starting values and configuration examples; the article [on what Google takes into account](https://www.wp-feint.com/https-security-headers-seo-trust/) covers their (small) role in SEO.

## Common mistakes

- Adding a header in two places (server and plugin) with different values.
- Forgetting `always`: without it, Apache and Nginx don't add the header to error pages.
- Chasing a perfect grade on an audit tool by enabling a strict CSP that breaks the editor or checkout.

In WP Feint, the free version sends `nosniff` from the first level of the Hardening module, and the Pro version manages [security headers](https://www.wp-feint.com/features/security-headers/) from the admin area, with a button that shows the headers actually received. A page served by an upstream cache may not carry them, though: the server configuration remains the safest place for a strict policy.

## Related terms

- [Content Security Policy (CSP)](https://www.wp-feint.com/glossary/content-security-policy/)
- [HSTS](https://www.wp-feint.com/glossary/hsts/)
- [Clickjacking](https://www.wp-feint.com/glossary/clickjacking/)
- [XSS (cross-site scripting)](https://www.wp-feint.com/glossary/xss/)
- [Fingerprinting](https://www.wp-feint.com/glossary/fingerprinting/)


## Sources

- [OWASP : HTTP Security Response Headers Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html)
- [MDN : Strict-Transport-Security](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security)
- [WordPress Developer Resources : send_frame_options_header()](https://developer.wordpress.org/reference/functions/send_frame_options_header/)
