Forum Discussion
Remove the page title from a modern page as well as the white space? Someone has done it.
Hi, edit the page and the change the layout to "Plain" then run the following PowerShell script to change the Page Layout from "Article" to "Home". Make sure you use your own SharePoint URL and use the proper ID of the Page
#Connect to SharePoint Online site
$SiteURL = "https://mysite.sharepoint.com/"
Connect-PnPOnline $SiteURL -Credential (Get-Credential)
#Get the ID of the Page
Get-PnPListItem -List SitePages
#Change Page layout from "Article" to "Home"
Set-PnPListItem -List SitePages -Identity "5" -Values @{"PageLayoutType"="Home"}
Here is a post where you can find step by step details: https://jamilhallal.blogspot.com/2022/01/how-to-remove-the-top-banner-from-sharepoint-online-modern-pages.html
- Stephen SnellMay 26, 2022Copper ContributorUsing a non-"home" page layout retains the page title in the browser tab. I wanted to remove the white space after the page title that is reserved for the author name. When I copied a home page, the browser tab no longer had the page title.
- Gfox77May 30, 2022Copper Contributor
If you "Copy" the home page back to page library, then highlight the page in the pages library, you have to manually go to page settings and update the properties (the Title and page name) to ensure they are not called "Home". In fact I normally save this a "blank page template".
- ganeshsanapMay 31, 2022MVP
If you are trying to create a new blank modern page without page title, follow this workaround: SharePoint Online: Create a blank page without header & title
For existing pages, you can change the page layout to Home using PnP PowerShell:
Set-PnPClientSidePage -Identity "MyPage.aspx" -LayoutType "Home"Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- mqheavenerMar 24, 2022Copper Contributor
After I put this into PowerShell ISE, I get error message(s)
PS C:\Users\Michael's Surface> #Connect to SharePoint Online site
$SiteURL = "https://michaelq.sharepoint.com/work/"
Connect-PnPOnline $SiteURL -Credential (Get-Credential)
#Get the ID of the Page
Get-PnPListItem -List SitePages
#Change Page layout from "Article" to "Home"
Set-PnPListItem -List SitePages -Identity "7" -Values @{"PageLayoutType"="Home"}These are the error message(s) I get
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Connect-PnPOnline : The term 'Connect-PnPOnline' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:3 char:1
+ Connect-PnPOnline $SiteURL -Credential (Get-Credential)
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-PnPOnline:String) [], CommandNotFoundExcepti
on
+ FullyQualifiedErrorId : CommandNotFoundException
Get-PnPListItem : The term 'Get-PnPListItem' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:5 char:1
+ Get-PnPListItem -List SitePages
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-PnPListItem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Set-PnPListItem : The term 'Set-PnPListItem' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:7 char:1
+ Set-PnPListItem -List SitePages -Identity "7" -Values @{"PageLayoutTy ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-PnPListItem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException