X-Frame-Options
X-Frame-Options is an HTTP response header that controls if a page can load in a frame. It has two valid values, DENY and SAMEORIGIN, and it cannot name other sites.
HTTP header
Also called XFO
Updated
On this page
Example
HTTP response header
X-Frame-Options: SAMEORIGIN
Only pages on the same origin may frame this page. Every frame above it must match, not only the direct parent.
How to set it
Send the header from the server of the page that goes in the frame. To block all frames, also send CSP frame-ancestors for current browsers.
# Only your own site may frame this page X-Frame-Options: SAMEORIGIN # No site may frame this page X-Frame-Options: DENY
A meta tag cannot set this header. To allow a partner site, remove X-Frame-Options and list the partner in CSP frame-ancestors.
Learn more
Sources