Fix SharePoint Access Denied When Creating a Web Part Page
Question details
A site collection administrator needs to create a SharePoint Web Part Page containing a status list but receives an Access Denied message.
- Product
- SharePoint in Microsoft 365
- Device & OS
- not provided
- Scenario
- Creating a classic Web Part Page or Report in a SharePoint site or Reports library.
- Observed behavior
- SharePoint reports Access Denied even though the administrator has Full Control and publishing features are enabled.
Identify the affected site URL and the library where you are creating the page. Ask a SharePoint administrator to check custom script settings, since site collection Full Control alone may not override tenant restrictions.
Check and allow custom script for the affected SharePoint site
Use this approach when a custom script restriction prevents an authorized user from creating a classic Web Part Page.
Allowing custom script can increase security risk. A SharePoint administrator should confirm that it is required and permitted by the organization before changing the setting.
In SharePoint Online Management Shell, run Connect-SPOService -Url https://contoso-admin.sharepoint.com, replacing the URL with your organization's SharePoint admin center URL. Sign in with an account authorized to administer SharePoint.
Run Get-SPOSite -Identity https://contoso.sharepoint.com/sites/SiteName | Select-Object Url,DenyAddAndCustomizePages, replacing the URL with the affected site URL. A disabled custom script setting may block the page creation.
Run Set-SPOSite -Identity https://contoso.sharepoint.com/sites/SiteName -DenyAddAndCustomizePages 0 using the affected site URL. Apply this only if your organization's security policy permits it.
Return to the affected library and select New > Web Part Page or Report, if available. Try adding the status list again; setting changes may take time to propagate.

Verify the site, library permissions, and another user's access
Use these checks if allowing custom script does not resolve the error or the page creation option is unavailable.
Work with Office documents in WPS Office
WPS Office is a free, lightweight alternative for everyday document, spreadsheet, and presentation work. Its familiar interface and Office format compatibility make it easy to move existing files, although it cannot change SharePoint permissions or create SharePoint Web Part Pages.

Frequently Asked Questions
Why do I get Access Denied when I have Full Control?
A tenant or site custom script restriction can block classic page creation even for a site collection administrator. Ask a SharePoint administrator to check the site's DenyAddAndCustomizePages setting.
Does enabling publishing features also enable custom script?
No. Publishing features and custom script restrictions are separate settings. A SharePoint administrator can check custom script with Get-SPOSite in SharePoint Online Management Shell.
How long should I wait after allowing custom script?
Changes may take time to propagate and can take up to 24 hours. Also check whether your tenant automatically reapplies the restriction within 24 hours.
What if Web Part Page does not appear under New?
Check that you are in the intended library and that the site and library support the classic page type. Also review Settings > Library settings > Permissions for this document library.




