webzod
account

Stop other sites from framing your pages on Netlify

headers.clickjacking.missing · effort: minutes

Why it matters

Without frame-ancestors or X-Frame-Options any site can load your pages in an invisible frame and trick visitors into clicking buttons they cannot see. One header tells browsers which sites, if any, may frame them.

The fix

  1. Add the lines below to _headers in the publish directory (or [[headers]] in netlify.toml) and redeploy. If you already set a Content-Security-Policy there, add frame-ancestors 'self' to it instead of a second line.
  2. _headers rules do not apply to Netlify Functions, Edge Functions or proxied responses; those must send the headers themselves.
_headers
/*
  X-Frame-Options: SAMEORIGIN
  Content-Security-Policy: frame-ancestors 'self'

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.