logo
search
Permission & Access Issues

How to Disable the SharePoint Embed Code Button to Protect Documents

Olivia MillerOlivia Miller Sep 28, 2026 869 views

Question details

The user wants to disable the Embed Code button at the site or tenant level to prevent users with restricted viewing permissions from copying it and sharing proprietary documents.

How to Disable the SharePoint Embed Code Button to Protect Documents
Product
SharePoint Online
Device & OS
not provided
Scenario
Attempting to protect proprietary and sensitive documents on a SharePoint site from unauthorized embedding or sharing.
Observed behavior
Users with restricted viewing permissions can still see and copy the Embed Code option, and SharePoint lacks a native toggle to disable this.
Before you start

Ensure you have Site Administrator or Tenant Administrator privileges so you can review existing sharing controls and permission levels for your SharePoint environment.

Solution 1Recommended

Review Site Permissions and Request Feature from Microsoft

Since SharePoint Online does not offer an out-of-the-box setting to disable the Embed Code button, you must rely on strict document permissions to protect content and submit a feature request.

Currently, SharePoint Online does not provide a native setting to disable or hide the Embed Code button at either the site or tenant level.

To protect sensitive content, you must rely on strict document permissions, Information Barriers, or Sensitivity Labels. Keep in mind that even if a user copies the embed code, anyone trying to view the embedded document elsewhere will still be prompted to authenticate and must have the appropriate permission to view it.

1
Review sharing controls

Go to your SharePoint Admin Center, select 'Policies', and then click on 'Sharing' to ensure external sharing is restricted to the appropriate levels for your organization.

2
Adjust library permissions

Navigate to the specific document library on your site. Click the gear icon for Settings, select 'Library settings', click 'More library settings', and choose 'Permissions for this document library' to remove unnecessary user groups or assign 'Restricted View'.

3
Submit feedback to Microsoft

Navigate to the Microsoft Feedback Portal (feedbackportal.microsoft.com) for SharePoint and submit a formal feature request to allow tenant admins to disable the Embed Code button.

Review Site Permissions and Request Feature from Microsoft
Embedded Viewer Authentication: The embed code does not bypass permissions. An embedded SharePoint document will refuse to load for any user who does not already possess access rights to the original file.
Free Microsoft Office alternative

Secure Your Local Documents with WPS Office

If you are struggling with SharePoint's online access controls for sensitive files, consider managing your proprietary documents locally. WPS Office is a free, lightweight Microsoft Office alternative that allows you to easily set robust document passwords and encryption for Word, Excel, and PDF files without relying on complex cloud permissions.

Password protect and encrypt proprietary documents locallyFully compatible with Microsoft Word, Excel, and PowerPoint formatsLightweight design with a familiar, easy-to-use interfaceSeamless offline document management for maximum privacy
microsoft office alternative - wps office

Frequently Asked Questions

Can I use custom CSS or scripts to hide the Embed Code button in SharePoint Online?

In modern SharePoint Online sites, injecting custom CSS or scripts to hide native UI elements like the Embed Code button is heavily restricted and not officially supported by Microsoft, unlike in older classic SharePoint sites.

Does restricting a user to 'View Only' prevent them from accessing the Embed Code?

No. Users with 'View Only' permissions can still access and copy the Embed Code. However, anyone attempting to view the embedded document on another site will still need the appropriate SharePoint permissions to see the content.

How can I prevent users from downloading or printing my proprietary SharePoint documents?

You can assign the 'Restricted View' permission level or apply Microsoft Purview Sensitivity Labels. This allows users to view documents in the web browser but removes their ability to download, print, or sync the files.