Sitewalk / Guides / Issue guides / Clickjacking protection
Clickjacking protection: how to check your headers and fix them
Clickjacking means another site loads your page in an invisible frame and tricks visitors into clicking buttons they cannot see. Two headers stop it: Content-Security-Policy: frame-ancestors and the older X-Frame-Options.
Does your site have it?
curl -s -o /dev/null -D - https://yoursite.com/
Look for x-frame-options or a content-security-policy line that contains frame-ancestors. If neither is there, other sites can frame your pages. MDN says the same: without any such mechanism the browser allows embedding.
The 2 problems
| What you see | The problem |
|---|---|
No x-frame-options and no frame-ancestors | Missing clickjacking protection. |
x-frame-options: ALLOW-FROM ... or another value, and no frame-ancestors | Invalid value. MDN calls ALLOW-FROM obsolete: modern browsers ignore the header completely. |
Why it matters
This matters most for login, account and checkout pages. Sitewalk checks the home page response.
How to fix it
Send both headers:
Content-Security-Policy: frame-ancestors 'self' X-Frame-Options: SAMEORIGIN
- In nginx:
add_header Content-Security-Policy "frame-ancestors 'self'" always;andadd_header X-Frame-Options SAMEORIGIN always;. In Apache:Header always set Content-Security-Policy "frame-ancestors 'self'"andHeader always set X-Frame-Options SAMEORIGIN. Tested on 16 Nov 2026; In nginx, alocationblock that has its ownadd_headerline drops every header set above it, so repeat the headers there. - Use
frame-ancestors 'none'andX-Frame-Options: DENYif nobody should embed the page. - If another domain of yours must embed the page, list that domain in
frame-ancestors.X-Frame-Optionscannot list one, which is whyALLOW-FROMexisted and failed. - Setting it in a
<meta>tag does not work. MDN saysX-Frame-Optionsis only enforced as an HTTP header. Set it in the server, CDN or host settings.
Check it worked
Run the curl command again and read both lines. Then run an audit.
What Sitewalk found on real sites
- Missing protection: 51 of 87 sites (58.6%), the most common header gap.
- Invalid value: 0 of 42 sites, counted for audits since 7 Nov 2026.
Our own site sends both headers (checked 16 Nov 2026).
Check your whole site in one sentence
Sitewalk checks these headers along with 200+ other technical SEO checks. In ChatGPT, say:
Audit yoursite.com for technical SEO problems
Checked on 16 Nov 2026. Header behaviour from MDN Web Docs, read 16 Nov 2026. Sitewalk counts are from 87 audited sites, each site's latest audit: a small early-user group, a first look and not a survey.