Apex Flow Shield Free scan
Menu

Clickjacking protection explained

Clickjacking is when another website loads your page inside a hidden or disguised frame and tricks visitors into clicking something on your page while they think they are clicking something else. To block it, tell browsers who may frame your pages, with the frame-ancestors directive of a Content Security Policy or the older X-Frame-Options header. These rules restrict who can frame your pages; a site you allow can still show your page in a deceptive frame, so allow only sites you trust.

What the Shield scan checks

Clickjacking protection, worth 10 of 100 points. Shield requests your HTTPS home page, follows up to four HTTPS redirects and reads the headers of the final response. The check passes when the Content-Security-Policy header contains the text frame-ancestors, or when the whole X-Frame-Options value, after trimming spaces, is DENY or SAMEORIGIN, in any letter case. Shield looks for matching header text; your browser determines whether framing is actually blocked.

If the check fails, the scan tells you: Add frame-ancestors to the policy or send X-Frame-Options.

How the attack works

The attacker's page loads yours in a frame, makes it invisible or disguises it, and lines it up under something the visitor wants to click. The click lands on your page. If the browser sends the visitor's login cookie to the framed page and the action needs no further confirmation, the action can run under the visitor's account.

The two headers that block it

Content-Security-Policy: frame-ancestors 'none'
X-Frame-Options: DENY

Both rules work on origins. An origin is the scheme, hostname and port together, so https://www.example.com and https://shop.example.com are different origins.

Before you enforce a rule, test anything that frames your pages on purpose, such as payment embeds, booking forms or builder previews.

Which one to use

Set frame-ancestors in your Content Security Policy on your host, CDN or web server. It is the current standard, it can name exactly which origins may frame you, and a browser that enforces it ignores X-Frame-Options. If your pages forbid all framing or allow only the same origin, also send the matching X-Frame-Options value as a fallback for older browsers that do not support frame-ancestors. If you allow a partner's site, leave X-Frame-Options off those pages, because older browsers that rely on it would block the partner too; those older browsers then get no framing protection on those pages. On 27 November 2026, this website sent both: frame-ancestors 'none' and X-Frame-Options: DENY.

Check your clickjacking protection now

Type your website address to run the free scan. It checks this and the other 10 items. No account, no email.

The interactive scan needs JavaScript. See the checks you can run yourself.

Questions

Can a site I allow still trick my visitors?

Yes. A site you allow can show your page in a deceptive frame just as an attacker would, so list only origins you trust. In nested frames the browser checks every page around yours, so each of those origins must be allowed.

Should I use DENY or SAMEORIGIN?

DENY, or frame-ancestors 'none', if none of your pages is ever shown in a frame. SAMEORIGIN, or frame-ancestors 'self', if pages on the same origin frame each other. If a page on a different origin, such as a website builder's preview, needs to embed your page, list that framing origin in frame-ancestors.

Will this stop my site appearing in Google or in link previews?

No. Search engines and link previews fetch your page directly; they do not show it inside a frame. It does stop tools that display your live site in a frame, such as some website builders' preview panes, so test those before you enforce the rule.

Can I add these protections with a meta tag?

No. X-Frame-Options and frame-ancestors only work when they are sent as HTTP response headers, and a Content-Security-Policy-Report-Only header does not block framing.

Sources

Written by Apex Flow Labs LLC for Apex Flow Shield. A score of 100 means the responses Shield received passed all 11 of its checks. It does not prove each setting is configured well, and no scan can show that a website cannot be attacked.

All website security guides