Skip to content
ClickJack Test

← Refused to connect

docs.google.com refused to connect

Why Google Docs will not load in a frame, and what to do. Headers checked 2026-11-30.

A Google Docs, Sheets or Slides URL in a frame got a response that blocks framing. If you are embedding a file, use the embed code from Publish to web, or for a form, the embed code from Send. If you only use Google Docs, you are most likely signed in to more than one Google account.

What the site sends

Framing header
Redirects a signed-out request to Google sign-in (accounts.google.com), which sends X-Frame-Options: DENY
Checked URL
https://docs.google.com/
Checked on
2026-11-30

Test it live →

Why it happens

The browser names the host whose response blocked the frame. Google decides per request, based on the URL and on who is signed in. In our signed-out checks, the Docs home page and /copy links sent the frame to Google sign-in, which sends X-Frame-Options: DENY. If your error names accounts.google.com instead, that is what happened.

The embed URLs that Google gives you under Publish to web, and the Forms embed code, are built for other sites. They sent no framing header in our checks.

Fix it if you are embedding Google Docs

Publish the file and embed the published URL

In Docs, Sheets or Slides, open File, then Share, then Publish to web. Click Embed, choose your options, click Publish, and copy the HTML. Be careful: depending on your account settings, a published file can be visible to everyone on the web.

<!-- Docs -->
<iframe src="https://docs.google.com/document/d/e/PUBLISHED_ID/pub?embedded=true"></iframe>

<!-- Sheets -->
<iframe src="https://docs.google.com/spreadsheets/d/e/PUBLISHED_ID/pubhtml?widget=true&amp;headers=false"></iframe>

<!-- Slides -->
<iframe src="https://docs.google.com/presentation/d/e/PUBLISHED_ID/embed?start=false&amp;loop=false&amp;delayms=3000"
  allowfullscreen></iframe>

Embed a form from the Send menu

Forms are not published to the web. Open the form, click Send, then the Embed tab at the top, and copy the HTML.

<iframe src="https://docs.google.com/forms/d/e/FORM_ID/viewform?embedded=true"></iframe>

Test as a visitor

You are signed in with an account that can open the file. Your visitors are not. Open your page in a private window, where you are signed out, to see what they see.

If you only see the error

Being signed in to more than one Google account is a common cause. Google may not know which account the frame should use, and can fall back to your default account. If that account cannot open the file, the frame cannot show it. Open the page in a private window and sign in with only the account that has access. To fix it for good, sign out of every Google account, then sign in first with the one you need: in many cases Google treats the first account you sign in with as the default.

If you use one account and it still fails, check third-party cookies. A frame from Google on another site is third-party, so a browser setting or an extension that blocks third-party cookies hides your Google session from it. Allow third-party cookies for the site you are on, or turn the blocking extension off for it.

FAQ

It works for me and fails for other people. Why?

You are signed in with an account that can open the file. They are not. Publish the file to the web, or share it with them, then test in a private window.

Can I swap /edit for /preview instead of publishing?

Google does not document a /preview URL for Docs, Sheets or Slides. In our check, a Sheet shared with anyone who has the link loaded at /preview with no framing header, but an undocumented URL can change at any time. Publish to web is the supported way.

Check your headers

See whether a site sends X-Frame-Options or CSP frame-ancestors, and what browsers will do with them.