Enable Content Editor and Script Editor Web Parts in SharePoint Online
Question details
The user needs to make the Content Editor and Script Editor Web Parts available for a specific SharePoint Online site collection.

- Product
- Microsoft SharePoint Online
- Device & OS
- not provided
- Scenario
- Custom scripts have been enabled at the tenant level, but the user still cannot add the classic Content Editor or Script Editor Web Part to a site.
- Observed behavior
- The Web Parts remain unavailable when the site collection denies custom scripts. Modern SharePoint pages also do not support these classic Web Parts.
Confirm the target site collection URL and whether the page is classic or modern. To change the site's custom-script setting, use a SharePoint administrator account and the SharePoint Online Management Shell, and obtain approval for the security implications of allowing custom scripts.
Allow custom scripts on the specific SharePoint Online site collection
Use this method when Content Editor and Script Editor are missing from a classic page because the target site denies custom scripts.
A tenant-level custom-script setting does not necessarily change the setting on every existing site collection. Apply the change to the specific site collection where the Web Parts are needed.
Allowing custom scripts enables users with appropriate permissions to add code that can run in a visitor's browser. Use this setting only for trusted authors and approved content.
Launch SharePoint Online Management Shell. If the module is not installed, open PowerShell and run Install-Module -Name Microsoft.Online.SharePoint.PowerShell, following your organization's software installation policy.
Run Connect-SPOService -Url https://tenant-admin.sharepoint.com and sign in with a SharePoint administrator account. Replace tenant with your organization's actual tenant name.
Run Set-SPOSite -Identity https://tenant.sharepoint.com/sites/site -DenyAddAndCustomizePages 0. Replace the example address with the target site collection URL, not a page or document URL.
Run Get-SPOSite -Identity https://tenant.sharepoint.com/sites/site | Select-Object Url,DenyAddAndCustomizePages. Confirm that DenyAddAndCustomizePages reports Disabled, meaning the restriction is disabled, and allow time for the change to apply.
Open the target classic page and choose Edit. Click an editable area or Web Part zone, then select Insert > Web Part. Under Media and Content, look for Content Editor or Script Editor.

Use supported Web Parts on modern SharePoint pages
Use this approach when the page is modern, where classic Content Editor and Script Editor Web Parts are not supported.
Work on Office documents with WPS Office alongside SharePoint
WPS Office is a free, lightweight, easy-to-use alternative for working on Office documents associated with your SharePoint workflow. Its familiar interface and Microsoft Office format compatibility make migration straightforward, but it does not change SharePoint permissions or enable Web Parts.

Frequently Asked Questions
Why are the Web Parts still missing after I enable custom scripts at the tenant level?
The target site collection may still deny custom scripts. Connect to SharePoint Online Management Shell and check the site with Get-SPOSite -Identity <site-url> | Select-Object DenyAddAndCustomizePages. For an approved classic-page scenario, use Set-SPOSite -Identity <site-url> -DenyAddAndCustomizePages 0.
Can I add Script Editor or Content Editor to a modern SharePoint page?
No. These are classic Web Parts. On a modern page, select Edit and use Text for formatted content, Embed for permitted embedded content, or an approved SPFx Web Part for custom functionality.
Do I need to enable SharePoint Server Publishing to make these Web Parts appear?
Publishing is not the fix for a site-level custom-script restriction and does not enable classic Web Parts on modern pages. First check the page type and the site's DenyAddAndCustomizePages setting. Do not use SharePoint Server-only PowerShell commands as SharePoint Online instructions.
Why does SharePoint block custom scripts again after I enable them?
SharePoint Online normally resets a site's custom-script allowance to blocked within 24 hours. Treat the PowerShell change as temporary and use supported modern Web Parts or an administrator-approved SPFx solution for ongoing functionality.




