Can not upload webpages to Site Pages under modern Group/Team Sites.

Occasional Contributor

While i am trying to migrate content from legacy sites to the modern team/group sites i faced with an issue that it is not possible to upload ".aspx" files to site pages library.


Does any one know if this is an expected behaviour if yes why?

Any setting recommendations which will help me to migrate/upload ".aspx" files to SitePages library.

1 Reply
best response confirmed by Rajashekhar Sheelvant (Occasional Contributor)

I have got the root cause and the solution of this issue from Microsoft support team as below.

In order to allow the upload .aspx files to the site pages library in modern group/team sites, the “Custom Scripting” Feature must be enabled on the group site.

To do so,

using the SharePoint Online Management Shell, running the script “Set-SPOsite <SiteURL> -DenyAddAndCustomizePages 0” will allow .aspx pages to be uploaded to the group site.