SharePoint Document Issues

Enable Content Editor and Script Editor Web Parts in SharePoint Online

Steven ParkerSteven Parker Nov 13, 2026 868 views

Question details

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

Enable Content Editor and Script Editor Web Parts in SharePoint Online
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.
Before you start

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.

Solution 1Recommended

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.

1
Open SharePoint Online Management Shell

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.

2
Connect to the tenant administration endpoint

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.

3
Enable custom scripts for the target site

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.

4
Verify the site setting

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.

5
Check the classic Web Part gallery

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.

Allow custom scripts on the specific SharePoint Online site collection
The custom-script allowance is temporary: Under current SharePoint Online behavior, allowing custom scripts on a site is normally reset to blocked within 24 hours. This setting does not make classic Web Parts available on modern pages.
Free Microsoft Office alternative

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.

Edit downloaded SharePoint documents locally, then upload the updated files through your organization's approved workflow.Work with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTX.Use a familiar Office-style interface to ease the transition from Microsoft Office.Access document, spreadsheet, and presentation tools in one lightweight application.
microsoft office alternative - wps office

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.