Can you embed facebook.com in an iframe?

No — facebook.com blocks iframe embedding. facebook.com responds with the HTTP header `X-Frame-Options: DENY`. This is the strictest possible setting: the page refuses to load inside any iframe, on any website, including its own. There is no allowlist and no exception.

Live Test In Your Browser

We just tried loading facebook.com in a real iframe below. If the site appears, embedding works from your browser. If it stays blank or shows an error, it is blocked.

Open in the full tester →

What facebook.com Sends

X-Frame-Options: deny

X-Frame-Options: DENY. Because the header is set to DENY, the browser blocks the frame before the page renders and shows a "refused to connect" error instead. No client-side trick gets around it — the decision is made by facebook.com's server on every response. If you need this content on your site, you must use an official embed endpoint (if one exists) or link out to it.

Source: curated reference · last checked 2026-06-12

The Right Way To Embed Facebook

Use the Facebook Page Plugin or Post embed code from the developer tools.

<iframe src="https://www.facebook.com/plugins/page.php?href=PAGE_URL&tabs=timeline"
  width="340" height="500"
  style="border:none;overflow:hidden"
  scrolling="no" frameborder="0"
  allow="clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>

facebook.com sends X-Frame-Options: DENY. Only the official plugin endpoints under /plugins/ can be embedded.

Full guide: how to embed Facebook →