Glossary / X-Frame-Options

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 invisible buttons.

Check your site

>

The header has two working values. DENY forbids showing the page in a frame anywhere. SAMEORIGIN allows framing only on pages from the same domain, which is handy when you embed your 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 is really clicking a button on your site, confirming a payment or changing a setting.

X-Frame-Options is an old and 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 lets you list specific allowed domains.

Example

X-Frame-Options: SAMEORIGIN

Common mistakes

Related terms

Found problems?

Slow hosting, SSL trouble or frequent downtime? Move to TomisHost: fast hosting with free SSL, daily backups and free migration help.

TomisHost hosting