Why SharePoint Online Blocks External-Domain Iframes
Question details
Understand why an external website cannot embed a SharePoint Online page in an iframe and why the iframe HTML setting does not override the restriction.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- A user wants to display a SharePoint Online page inside an iframe on a website hosted on another domain.
- Observed behavior
- The browser blocks the framed SharePoint page even when the SharePoint setting allows contributors to insert iframe HTML.
Confirm that the iframe source is a SharePoint Online page and that the website hosting the iframe is on an external domain. Check the browser developer console for a framing or Content Security Policy error.
Link to the SharePoint Online page instead of framing it
Use a direct link when visitors need to access a SharePoint page from an external website.
SharePoint Online uses browser-enforced security headers, such as X-Frame-Options and Content Security Policy frame-ancestors directives, to restrict where its pages can be framed. There is no supported setting that overrides these headers to allow an external site to frame a SharePoint Online page.
The HTML Field Security setting controls which external iframe content contributors can add to SharePoint. It does not control whether an external website can frame a SharePoint page.
Open the SharePoint Online page and copy its URL from the browser address bar, or use Share to copy a link if that option is available.
In your website editor, replace the iframe with a link or button that points to the copied SharePoint URL.
Open the link as an intended visitor and confirm that the visitor has the required SharePoint permissions and can sign in if prompted.

Work with Office documents in WPS Office
WPS Office is a free, lightweight alternative for working with documents in a familiar interface. Its Office format compatibility helps you move existing files into WPS, although it cannot change SharePoint Online's iframe restrictions.

Frequently Asked Questions
Why does my SharePoint page show an error inside an iframe?
SharePoint Online sends security headers that can prevent its pages from being framed by external domains. Open your browser's developer console to check for an X-Frame-Options or Content Security Policy framing error.
Does allowing iframes in HTML Field Security let external sites embed SharePoint pages?
No. HTML Field Security governs external iframe content inserted into SharePoint; it does not change the headers that restrict embedding SharePoint pages on external sites.
Can I change the SharePoint Online headers to allow my website to frame a page?
There is no supported SharePoint Online setting to override those framing headers for an external website. Use a direct link to the SharePoint page instead.
Will a direct link let external visitors see the SharePoint page?
Only if they have the required access. Check the page's sharing permissions and your organization's external sharing settings, then test the link with an intended visitor.




