DENY
- Effect (per MDN)
- The document cannot be loaded in any frame, regardless of origin
- Status
- Works
X-Frame-Options is an HTTP response header that controls whether a page can be framed. Learn DENY vs SAMEORIGIN, why ALLOW-FROM is obsolete and what replaces it.
X-Frame-Options is an HTTP response header that tells a browser whether it may render your page in a frame, iframe, embed or object. MDN says sites use it to avoid clickjacking and some cross-site leaks. The two working values are DENY and SAMEORIGIN. The ALLOW-FROM value is obsolete, and Content-Security-Policy frame-ancestors is the modern replacement.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
X-Frame-Options as an HTTP response header that "can be used to indicate whether a browser should be allowed to render the document in a <frame>, <iframe>, <embed> or <object>." The point is to stop other sites from embedding your pages, which MDN says helps avoid clickjacking attacks and some cross-site leaks.RFC 7034 states the same purpose: it describes a policy sent from the server to the browser about whether the content may be displayed in frames that are part of other web pages. The RFC is Informational, not an Internet Standards Track document. It was written down after browser vendors had already shipped the header.
The header is enforced by the browser that renders your page inside someone else's page. Set it as part of your wider security headers.
DENYSAMEORIGINALLOW-FROM uriRFC 7034 words the two working values as rules for the browser. With DENY, a browser "MUST NOT display this content in any frame." With SAMEORIGIN, it "MUST NOT display this content in any frame from a page of different origin than the content itself."
X-Frame-Options: DENY
X-Frame-Options: SAMEORIGINALLOW-FROM points to the replacement: the Content-Security-Policy header has a frame-ancestors directive "which you should use instead." RFC 7034 says ALLOW-FROM supports only one serialized origin, while frame-ancestors takes a space-separated list of sources.Decision rule: if nobody should embed your pages, send DENY or frame-ancestors 'none'. If only your own site frames them, use SAMEORIGIN or frame-ancestors 'self'. If a named partner must embed them, use frame-ancestors only.
Content-Security-Policy: frame-ancestors 'none'
Content-Security-Policy: frame-ancestors 'self' MDN warns that setting X-Frame-Options in a <meta> element has no effect. It is only enforced through HTTP headers, so set it on the server, CDN or framework. MDN also says the CSP frame-ancestors directive is not supported in a <meta> element.
Send it on every HTML response you want protected, not just the homepage.
A widget, preview tool or checkout that you iframe from your own domain needs SAMEORIGIN, not DENY.
Browsers ignore the entire header when they see it, so a page that relied on it may be unprotected.
Load the page, open the Network tab and select the document request.
Look for X-Frame-Options and for a Content-Security-Policy header with frame-ancestors.
Put the URL in an iframe on a page from another origin and confirm the browser refuses to render it when you expect it to.
4 questions people ask next, answered from the sources on this page.
It tells the browser whether it may display your page inside a frame, iframe, embed or object on another page. Sites use it to avoid clickjacking.
Use DENY if no one should embed the page. Use SAMEORIGIN if only pages from your own origin should frame it.
The ALLOW-FROM directive is obsolete and ignored by modern browsers. MDN tells sites to use CSP frame-ancestors instead of it.
No. MDN says a meta element has no effect. It only works as an HTTP response header.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.