Others

How to Enable SharePoint HTML Frame Embedding Across Multiple Sites

Emma BrownEmma Brown Oct 9, 2026 871 views

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.

How to Enable SharePoint HTML Frame Embedding Across Multiple Sites
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.
Before you start

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.

Solution 1Recommended

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.

1
Open SharePoint Online Management Shell

Launch the SharePoint Online Management Shell as an administrator on your PC.

2
Connect to your SharePoint Admin Center

Run the command 'Connect-SPOService -Url https://yourdomain-admin.sharepoint.com' and log in with your global or SharePoint admin credentials.

3
Execute the Configuration Script

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.

4
Verify the Changes

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.

Automate Frame Embedding Configuration via PowerShell
PowerShell Expertise Required: If you are unfamiliar with writing PowerShell scripts for SharePoint, it is highly recommended to consult a SharePoint developer or contact Microsoft Support for the exact script tailored to your tenant.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Install and Launch: Follow the on-screen instructions to install the software, then launch WPS Office.
  3. 3. Open Your Office Documents: Simply drag and drop your existing Word, Excel, or PowerPoint files into WPS Office to start editing immediately.
Fully compatible with Microsoft Office formats (DOCX, XLSX, PPTX)Free and lightweight alternative to heavy Microsoft 365 applicationsFamiliar user interface requiring zero learning curveBuilt-in PDF editing, splitting, and merging capabilities
microsoft office alternative - wps office

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.