How to Enable SharePoint HTML Frame Embedding Across Multiple Sites
Question details
The user wants to know if there is a global setting in SharePoint to allow contributors to insert iframes or HTML frames from any domain across all sites simultaneously.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Configuring site security and content embedding policies for multiple SharePoint site collections.
- Observed behavior
- Currently, the setting to allow frames from any domain lacks a native global toggle and must be enabled individually for each site.
Ensure you have Site Collection Administrator or SharePoint Admin privileges, and verify that allowing cross-domain frames aligns with your organization's security and compliance policies.
Automate Frame Embedding Configuration via PowerShell
Since SharePoint lacks a global UI toggle, using a PowerShell script is the most efficient method to apply this HTML field security setting across multiple sites.
To bypass the limitation of configuring sites one by one, administrators can utilize the SharePoint Online Management Shell. This allows you to loop through all site collections and update their HTML Field Security settings programmatically.
Launch the SharePoint Online Management Shell as an administrator on your PC.
Run the command 'Connect-SPOService -Url https://yourdomain-admin.sharepoint.com' and log in with your global or SharePoint admin credentials.
Run a PowerShell script that loops through your target sites using 'Get-SPOSite' and applies 'Set-SPOSite -Identity $site.Url -DenyAddAndCustomizePages 0' or custom PnP PowerShell scripts to update the site's allowed iframe domains property.
Log into one of the updated SharePoint sites, navigate to Site Settings > HTML Field Security, and verify that contributors are now permitted to insert frames from external domains.

Enable HTML Frame Settings Manually per Site
If you only need to configure a handful of sites, you can manually adjust the HTML Field Security settings within each site collection's settings menu.
Try WPS Office for Seamless Document Collaboration
While SharePoint handles site-level content hosting and frame embedding, WPS Office provides a free, lightweight, and highly compatible alternative for your everyday document creation and editing needs. It handles Word, Excel, and PowerPoint files flawlessly without the heavy resource footprint.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install and Launch: Follow the on-screen instructions to install the software, then launch WPS Office.
- 3. Open Your Office Documents: Simply drag and drop your existing Word, Excel, or PowerPoint files into WPS Office to start editing immediately.

Frequently Asked Questions
Can I enable iframe embedding for all SharePoint sites directly from the admin center UI?
No, SharePoint Online does not currently offer a global user interface setting to configure HTML Field Security across all sites simultaneously. It must be done per site or automated via PowerShell.
What are the security risks of allowing HTML frames from any domain in SharePoint?
Allowing iframes from any external domain can expose your site to security vulnerabilities, such as clickjacking or the embedding of malicious third-party content. It is generally recommended to only allow specific, trusted domains.
Why am I getting an 'embedding restricted' error when inserting an iframe?
This error occurs when the external domain of the embedded content is not explicitly permitted in your site's HTML Field Security settings. You must navigate to Site Settings and add the specific domain to the allowed list.




