DELAPARRA
Index
Color
NL
Category: HTTP headers

X-Frame-Options

Explained by Updated

What is X-Frame-Options?

X-Frame-Options: Whether your page can be embedded in an iframe. Defends against clickjacking. Use DENY or SAMEORIGIN. X-Frame-Options controls whether other sites may show your pages inside an iframe. DENY blocks all framing; SAMEORIGIN allows only your own site. It protects against clickjacking, where an attacker loads your page invisibly inside theirs and tricks visitors into clicking buttons, such as confirming a payment or changing settings, while they think they are clicking something else.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about X-Frame-Options

What should you keep in mind with X-Frame-Options?

The modern replacement is the frame-ancestors directive in Content-Security-Policy, which is more flexible and can list specific allowed sites. Many sites send both for compatibility with older browsers. Set it on every page unless you deliberately allow embedding, for example for a widget meant to be placed on other websites. Admin panels and account pages should never be frameable.

What does an example of X-Frame-Options look like?

X-Frame-Options: DENY

At a glance

CategoryHTTP headers
Explained by
Updated

More HTTP headers terms

All terms starting with X

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.