Hi @john john ,
Note: Clear Allow users to create new modern pages, users can still add pages from other modern pages, either from the New menu or from modern webparts (such as News).
You can prevent users from creating modern pages on a specific site by using PowerShell.
Powershell code:
# Load SharePoint Online Client Components SDK Module
Import-Module 'C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll'
# Set script constants
$sitePagesFeatureIdString = 'B6917CB1-93A0-4B97-A84D-7CF49975D4EC'
# Set up client context
$userName = Read-Host "Username"
$password = Read-Host "Password" -AsSecureString
$siteUrl = Read-Host "Site Url"
$webUrl = Read-Host "Server-Relative Web Url"
$context = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)
$context.Credentials = $credentials
# Get the list of existing features
$web = $context.Site.OpenWeb($webUrl)
$features = $web.Features
$context.Load($features)
$context.ExecuteQuery()
# Verify that the Site Pages feature is present in the web
if(($features | ? { $_.DefinitionId -eq $sitePagesFeatureIdString }).Count -eq 0)
{
Write-Host "The Site Pages feature is already disabled in this web"
return
}
# Remove the Site Pages feature from the web
$features.Remove((new-object 'System.Guid' $sitePagesFeatureIdString), $false)
$context.ExecuteQuery()
# Verify that the Site Pages feature is no longer present in the Web
$web = $context.Site.OpenWeb($webUrl)
$features = $web.Features
$context.Load($features)
$context.ExecuteQuery()
if(($features | ? { $_.DefinitionId -eq $sitePagesFeatureIdString }).Count -eq 0)
{
Write-Host "The Site Pages feature has been successfully disabled"
}
else
{
throw "The Site Pages feature failed to be disabled"
}
Please refer to: https://learn.microsoft.com/en-US/sharepoint/let-users-create-modern-site-pages?WT.mc_id=365AdminCSH_spo
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.