Custom scripting will be disabled by default for certain SharePoint Online templates starting September 15, 2025. Users can manage site property bag values without enabling custom scripting. Creation of new classic publishing site collections and activation of publishing features will be restricted. Existing sites remain unaffected.
We are implementing the following changes to custom scripting and classic publishing in SharePoint Online.
1. Disablement of custom scripting
Custom scripting will be disabled by default (setting DenyAddAndCustomizePages to 1 or $true) for sites created with the following templates:
Refer to this documentation to learn more about the security considerations of ungoverned scripting.
2. Ability to set site property bag valued without requiring custom scripting enablement.
Users no longer need to set DenyAddAndCustomizePages to $false or 0 (i.e. enable custom scripting) in a site to manage site property bag values. We have introduced a new AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled setting at the site level and at the tenant level to allow adding/managing site property bag values. Please see documentation here for tenant level setting and here for the site level setting.
3. Classic publishing sites creation and feature activation changes
Users will no longer be able to create new classic publishing related site collections or activate publishing features in existing site collections. This applies to both UX and API interactions.
Sites collections with the following templates cannot be created:
Existing classic publishing enabled site collections are unaffected and can continue regular usage, including creation of sub sites.
When this will happen
Both changes, the extended custom scripting governance and the new classic publishing restrictions, will take effect starting September 15, 2025.
How this will affect your organization
What you need to do to prepare
We recommend taking the following actions to prepare for these upcoming changes.
1. Inform owners of the classic publishing sites in your organization of these upcoming changes. Promote switching to use of Modern sites. Refer to this guide.
2. To temporarily opt out of the custom scripting enforcement in classic publishing sites for your tenant until March 15, 2026, use the following PowerShell command:
Set-SPOTenant -DelayDenyAddAndCustomizePagesEnforcementOnClassicPublishingSites $true
3. To temporarily opt out of custom scripting enforcement for a specific site (with any template) with tenant admin approval (effective for 24 hours), use the following PowerShell command:
Set-SPOSite <SiteURL>
4. If you need to allow the creation of new classic publishing site collections or enable publishing feature activations, use the following PowerShell command set the flag to allow.
Set-SPOTenant -AllowClassicPublishingSiteCreation $true
NOTE:
Compliance considerations
There is no impact or change to compliance.
Referenced content
Security considerations of allowing custom script - SharePoint in Microsoft 365 | Microsoft Learn
Allow or prevent custom script - SharePoint in Microsoft 365 | Microsoft Learn
SharePoint modernization guidance | Microsoft Learn