How to Stop Your Site Being Framed
Block clickjacking by declaring who may embed your pages in an iframe.
Without a framing policy, any site can load yours in an invisible iframe and trick a visitor into clicking something they cannot see — clickjacking. The modern fix is a Content-Security-Policy frame-ancestors directive, with X-Frame-Options as a fallback for older browsers. Both are single response headers.
Why It Matters
Clickjacking targets authenticated actions: a hidden frame over a bait page turns an innocent click into a real action on your site. The defence is one header, and it is missing far more often than it should be.
How to Fix
Set frame-ancestors in CSP
Add X-Frame-Options too
Set it at the edge
Check what you actually embed
Code Fix
textcurl -sI https://example.com | grep -i -E 'frame|content-security'
(no output)Content-Security-Policy: frame-ancestors 'self'
X-Frame-Options: SAMEORIGINPlatform-Specific Instructions
Add the headers in the server config rather than a plugin, so they apply to every response including uploads.
Set them in the headers() function in next.config, or at the proxy if one terminates TLS in front.
Fixed that one.
Now find the rest.
A free audit ranks every issue on your site by the score points it costs — and links each one straight to its guide.
Run a free audit