On this page
What this issue is
Clickjacking is a trick where an attacker loads your page inside an invisible frame (an iframe) on their own site. They put a bait button on top. The visitor thinks they are clicking the bait, but the click lands on your page: a form submit, a purchase button, a settings change.
Two response headers stop this. X-Frame-Options is the older one and accepts DENY or SAMEORIGIN. frame-ancestors is a directive of Content-Security-Policy and is the modern replacement. It lets you list exactly which sites may frame you. If both are sent, modern browsers follow frame-ancestors and ignore X-Frame-Options.
Why it costs you leads or sales
Clickjacking rarely shows up as a broken page, so the cost is indirect. Visitors can be tricked into submitting your forms, changing account settings or confirming actions they did not mean to. That produces junk leads, unwanted orders, refunds and complaints. Security scanners, enterprise buyers and some partners also flag the missing header in reviews, which can slow deals.
The risk is highest on pages with a single, high-value click: checkout confirmation, login, account settings, admin screens and one-click booking.
- Visitor opens bait pageA page on another domain promises a prize or video
- Your page loads in hidden iframeNo X-Frame-Options or frame-ancestors to stop it
- Visitor clicks the baitThe click lands on your invisible button
- Unwanted actionForm sent, order placed or setting changed
Without a framing rule, the browser happily renders your page inside the attacker's page.
The visitor sees the top button; the click goes to the one underneath.
How to check if your site has it
You can check in under a minute. Run the command below and look for x-frame-options or a content-security-policy line containing frame-ancestors. If neither appears, the page can be framed.
curl -sI https://www.example.com/ | grep -iE 'x-frame-options|content-security-policy'You can also use the browser: open DevTools, go to the Network tab, reload, click the main document and read Response Headers. Check your key pages separately, not just the homepage: the form page, checkout and login. Headers can differ by path, especially behind a CDN or on a hosted checkout.
<!doctype html>
<iframe src="https://www.example.com/contact" width="800" height="600"></iframe>If your page appears inside the frame, it is not protected. If the frame is blank or shows a browser error, the header is working. Open DevTools Console to see the exact refusal message.
How to fix it
Decide first who, if anyone, should be allowed to frame your pages. Most sites need nobody except themselves, so use 'self'. If you embed your own forms or booking widget inside a partner site, list that partner's domain instead.
| Header value | Who can frame your page |
|---|---|
| frame-ancestors 'none' | Nobody, not even your own site |
| frame-ancestors 'self' | Only your own origin |
| frame-ancestors 'self' https://partner.example | You and the listed partner |
| X-Frame-Options: DENY | Nobody (older browsers) |
| X-Frame-Options: SAMEORIGIN | Only your own origin (older browsers) |
Choose a method
Use your host's header settings, a security plugin that offers HTTP header options, or add the code below to your child theme's functions.php.
Add the header in PHP
Paste: add_action('send_headers', function(){ header("Content-Security-Policy: frame-ancestors 'self'"); header('X-Frame-Options: SAMEORIGIN'); });
Clear caches
Purge your page cache and CDN so the new header is served.
Know the limit
Shopify controls response headers on storefronts and sets its own framing protection. You cannot edit server headers in the theme.
Check, don't edit
Run the curl check on your storefront and checkout. If a header is missing on a custom domain behind a proxy, fix it at that proxy.
Not possible in GTM
Tag Manager runs in the browser after the page loads, so it cannot set response headers. Use your server, CDN or host instead.
Check hosting settings
Webflow hosting adds some security headers by default. Check with curl whether your site sends a framing rule.
Use a proxy if needed
If a header is missing, put the site behind a CDN such as Cloudflare and add a response header rule there.
Check before changing
Funnels and sites are hosted by the platform, and you cannot set server headers in the builder. Run the curl check on your funnel URL.
Mind embeds
If you intentionally embed GoHighLevel forms in other sites, a strict 'self' rule on your own domain can break those embeds. Test them after any change.
Platform-managed
Wix sets response headers itself and does not let you edit them. Check with curl. If you need control, use a proxy or CDN in front of a connected domain, where the plan allows it.
Platform-managed
Squarespace does not offer custom response headers in its settings. Check with curl, and escalate to support if you have a compliance requirement.
nginx
In the server or location block add: add_header Content-Security-Policy "frame-ancestors 'self'" always; and add_header X-Frame-Options SAMEORIGIN always; then run nginx -t and reload.
Apache
Enable mod_headers and add: Header always set Content-Security-Policy "frame-ancestors 'self'" and Header always set X-Frame-Options SAMEORIGIN, then reload Apache.
CDN or Node
Add the same headers in a Cloudflare Transform Rule (modify response header) or in your framework middleware.
add_header Content-Security-Policy "frame-ancestors 'self'" always;
add_header X-Frame-Options SAMEORIGIN always;<IfModule mod_headers.c>
Header always set Content-Security-Policy "frame-ancestors 'self'"
Header always set X-Frame-Options "SAMEORIGIN"
</IfModule>Before
- No X-Frame-Options header
- No frame-ancestors directive
- Any site can embed your form or checkout page
After
- frame-ancestors 'self' sent on every page
- X-Frame-Options: SAMEORIGIN as fallback
- Other sites see a blocked frame
How to confirm it's fixed
Re-run the header check
Use the curl command on the homepage, a form page and checkout. Each should show your framing rule.
Repeat the frame test
Load the test.html file again. The frame should be blank and the Console should report a refusal to display the page.
Test your own embeds
Open any page where you intentionally embed your forms or widgets and make sure they still load.
Run a full journey by hand
Submit a test form and view a checkout page to be sure nothing else broke.
How to prevent it happening again
- Set the header at one level (server or CDN) so it covers every page, including error pages
- Document which partner domains are allowed to frame you and why
- Re-run the curl check after theme, plugin, host, CDN or proxy changes
- Check key paths, not only the homepage, since rules can differ by path
- Add a header check to your regular security scan or release checklist
- Review the allowed-domains list when you end a partnership
How FunnelGuard handles this
FunnelGuard does not check for missing X-Frame-Options or frame-ancestors today. It is a possible future check, not something you can switch on now.
What FunnelGuard does do is run your real customer journeys on a schedule, such as lead forms, checkouts and booking buttons. It verifies each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. That is useful after a header change: if a new framing rule breaks an embedded form or widget, a journey that depends on it can fail and you get an alert with a screenshot.
To watch for the missing header itself, run the curl command above on a schedule, add a header check to your CI pipeline, or use a header scanner such as the Mozilla Observatory or securityheaders.com. A free FunnelGuard plan (1 site, 2 journeys, daily checks, no card) can cover your main form and checkout while you do that.
Questions people ask
What is the X-Frame-Options header?
X-Frame-Options is an HTTP response header that tells browsers whether your page may be shown inside a frame or iframe on another site. The values are DENY (never) and SAMEORIGIN (only your own site). It protects visitors from clickjacking.
What is the difference between X-Frame-Options and frame-ancestors?
frame-ancestors is a Content-Security-Policy directive and the modern replacement for X-Frame-Options. It can list several allowed domains, while X-Frame-Options cannot. If both are sent, modern browsers follow frame-ancestors, so sending both covers old and new browsers.
How do I check if my website is vulnerable to clickjacking?
Run curl -sI https://yoursite.com/ and look for x-frame-options or frame-ancestors in the headers. Then load your page in an iframe from a local HTML file. If the page displays in the frame, it can be clickjacked.
Why is my page blank after adding X-Frame-Options?
The page is probably being embedded somewhere that the header now blocks, such as a partner site, a page builder preview or your own widget on another domain. Add the embedding domain to frame-ancestors instead of using DENY or SAMEORIGIN.
How do I add X-Frame-Options in WordPress?
Use your host's header settings or a security plugin with HTTP header options, or add a send_headers action in a child theme's functions.php that sends the header. Clear caches afterwards and check with curl.
Can I fix clickjacking with Google Tag Manager or JavaScript?
No. Tag Manager and page scripts run after the page loads, and framing protection must come from the HTTP response header. Frame-busting scripts are unreliable. Set the header on your server, CDN or host.
Does FunnelGuard detect missing X-Frame-Options?
No. FunnelGuard does not check this yet; it is a possible future check. It does run your forms and checkouts on a schedule, so it can reveal a journey broken by a new framing rule. Use curl or a header scanner for the header itself.