Enable Add and Customize Pages on a Modern SharePoint Site
Question details
Enable the Add and Customize Pages permission on a modern SharePoint site where an administrator is denied access.
- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- A SharePoint administrator with Full Control needs to customize pages on a modern team site.
- Observed behavior
- The Add and Customize Pages permission is denied even after custom scripts are enabled in the SharePoint admin center.
Confirm the URL of the affected site collection and have a SharePoint administrator account ready. Enabling custom scripts can increase security risks, so check your organization's policy before changing the setting.
Allow Custom Scripts for the SharePoint Site Collection
Use SharePoint Online PowerShell to change the site-level setting when the admin center setting has not cleared the permission denial.
The PowerShell command targets a site collection. If the affected page is in a subsite, identify its parent site collection before running the command.
Open PowerShell and run Install-Module -Name Microsoft.Online.SharePoint.PowerShell if the SharePoint Online Management Shell module is not installed.
Run Connect-SPOService -Url https://yourtenant-admin.sharepoint.com, replacing the URL with your tenant's SharePoint admin center URL, and sign in with an authorized administrator account.
Run Set-SPOSite -Identity https://yourtenant.sharepoint.com/sites/yoursite -DenyAddAndCustomizePages 0, replacing the URL with the affected site collection URL.
Wait for the change to propagate, then return to the affected SharePoint site and retry the action that was denied. You can also check the setting with Get-SPOSite -Identity https://yourtenant.sharepoint.com/sites/yoursite | Select-Object DenyAddAndCustomizePages.

Work on Office Documents with WPS Office
WPS Office is a free, lightweight alternative for editing documents, spreadsheets, and presentations in a familiar interface. Its Microsoft Office format compatibility helps you move existing files into your workflow, though it cannot change SharePoint permissions or custom script settings.

Frequently Asked Questions
Why is Add and Customize Pages denied when I have Full Control?
A site-level custom script restriction can block the permission even for a user with Full Control. Check the site collection's DenyAddAndCustomizePages setting with SharePoint Online PowerShell.
Which URL should I use with Set-SPOSite?
Use the affected site collection URL in the -Identity parameter. If the issue occurs in a subsite, identify its parent site collection rather than entering a page URL.
How can I verify that custom scripts are allowed?
After connecting with Connect-SPOService, run Get-SPOSite -Identity followed by the site collection URL and select DenyAddAndCustomizePages. A disabled setting indicates that custom scripts are allowed.
Why did the permission denial return later?
SharePoint may automatically reset the custom script setting to blocked. Recheck DenyAddAndCustomizePages and review your tenant's custom script enforcement policy.




