X-Frame-Options header not set
A scanner says X-Frame-Options header not set? Other sites can put your page in a frame. Send X-Frame-Options: DENY or SAMEORIGIN as a response header, or use CSP frame-ancestors.
Short answer
X-Frame-Options header not set means other sites can load your page in a frame, which MDN links to clickjacking. Send X-Frame-Options: DENY, or SAMEORIGIN if your own site frames the page, as an HTTP response header, for example in vercel.json or a Netlify _headers file. A meta tag has no effect. CSP frame-ancestors is the newer alternative.
Reviewed October 28, 2026
What it means in plain English
X-Frame-Options is a response header that says whether a browser may show your page inside a <frame>, <iframe>, <embed>, or <object>. MDN says sites use it "to avoid clickjacking attacks and some cross-site leaks."
MDN also says: "If this header is not sent, and the website has not implemented any other mechanisms to restrict embedding (such as the frame-ancestors CSP directive), then the browser will allow other sites to embed this document." That is what the scanner is flagging.
Likely causes
- The host was never told to send the header.
- The header was put in a
<meta>tag. MDN: "Setting X-Frame-Options inside the<meta>element ... has no effect." - The header uses
ALLOW-FROM. MDN calls it obsolete and says modern browsers that see it "will ignore the header completely."
How to fix it, step by step
- Decide whether any page of yours must appear in a frame. If none, use
DENY. If only your own site frames it, useSAMEORIGIN. - Add the header to every path:
X-Frame-Options: DENY
-
Where to add a response header:
- Vercel: the
headerslist invercel.json, with asourcepattern such as/(.*)and a list ofkeyandvaluepairs. - Netlify: a plain text
_headersfile in the publish directory, or[[headers]]innetlify.toml. Netlify says custom headers don't apply to content handled by a function or edge function, such as a server-rendered page, or to proxied content. Those must return the header themselves. - Your own server: set it in the web server config. MDN's X-Frame-Options page shows Apache, Nginx, and IIS examples.
- Vercel: the
-
If specific other sites must embed the page, use the CSP
frame-ancestorsdirective instead, for exampleContent-Security-Policy: frame-ancestors 'self' https://partner.example.com. MDN saysframe-ancestors 'none'"is similar toX-Frame-Options: deny," andX-Frame-Optionsis also supported in older browsers, so sending both is common. -
Redeploy and check the document response headers.
How to check it worked
- The document response includes
X-Frame-Options: DENYorSAMEORIGIN, or a CSP withframe-ancestors. - A test page on another site that frames yours shows a blank frame.
To add a full policy, see Content Security Policy header not set.
Questions people ask
Should I use DENY or SAMEORIGIN for X-Frame-Options?
DENY blocks every frame, including frames on your own site. SAMEORIGIN allows embedding only when all ancestor frames have the same origin as the page.
Does X-Frame-Options work in a meta tag?
No. MDN says setting X-Frame-Options inside a meta element has no effect. It is only enforced as an HTTP response header.
X-Frame-Options vs Content Security Policy frame-ancestors: which should I use?
MDN points to frame-ancestors for more options, such as listing the sites that may embed the page. Setting frame-ancestors to 'none' is similar to X-Frame-Options DENY, which older browsers also support.
Sources
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options (opens in a new tab)
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-ancestors (opens in a new tab)
- https://vercel.com/docs/project-configuration/vercel-json (opens in a new tab)
- https://docs.netlify.com/manage/routing/headers/ (opens in a new tab)
Related fixes
Keep going on your own.
The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.