Skip to main content

Remove Banner in SharePoint Online Modern Page

When we create a new page in SharePoint Online, The title area appears on the top with a banner image and the page title. SharePoint Online doesn’t allow you to save and publish a modern page without its “Title”. If you try to save a page with no title, you’ll get an error popup, “Could not complete that action: Page title cannot be blank.

We can use the following PowerShell Script to change the page layout type into a "Home"
#Config Variables
$SiteURL = "https://contoso.sharepoint.com/sites/demo"
$PageName = "Purchase-Order-List" #Just the page name without .aspx extention
Try {
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
#Change the Page layout
Set-PnPPage -Identity $PageName -LayoutType Home
Write-host -f Green "Page Title has been removed!"
}
catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}

Comments