Account

Glossary / X-Frame-Options

What is X-Frame-Options

X-Frame-Options is an HTTP header that tells the browser whether your page may be shown inside an <iframe> on another site. It protects against clickjacking, where an attacker embeds your site in a transparent frame and tricks the user into clicking buttons they cannot see.

Check your site

>

The header has two working values. DENY forbids showing the page in a frame anywhere. SAMEORIGIN allows framing only by pages from the same domain, which suits sites that embed their own pages.

Without this protection an attacker can load your site in an invisible iframe on top of a bait page. The user thinks they are clicking "Claim your prize", but the click lands on a button on your site and confirms a payment or changes a setting.

X-Frame-Options is an old, simple mechanism that every browser still supports. Modern projects often back it with the frame-ancestors directive in Content-Security-Policy, which is more flexible and can list specific allowed domains.

Example

X-Frame-Options: SAMEORIGIN

Common mistakes

Related terms