What is X-Frame-Options?

X-Frame-Options is an HTTP response header that controls whether your page can be rendered inside an iframe on another site. Values are `DENY` (no framing) or `SAMEORIGIN` (framing only on your own origin). It is the older version of CSP's `frame-ancestors` directive — modern apps should set both.

In more detail

Clickjacking works by loading your site in an invisible iframe on top of a decoy page. The attacker positions their decoy so users click elements on your site without realizing — confirming purchases, sharing data, or changing account settings. X-Frame-Options stops this by telling the browser to refuse to render your site inside a frame.

Both headers for maximum compatibility
X-Frame-Options: DENY
Content-Security-Policy: frame-ancestors 'none'

Why this matters

Why builders care

Clickjacking is especially dangerous for apps with one-click destructive actions (subscribe, pay, delete). Both headers are free to add and have no downside unless you legitimately embed your own site.

See where your site stands

Paste a URL, get a score in 60 seconds. Free, no signup.