PowerShell : Change the Layout of the SharePoint Page

Sathish Nadarajan
 
Solution Architect
July 9, 2021
 
Rate this article
 
Views
2261

In SharePoint Online, when we create a new modern page, by default, the header of the page is coming as below. Sometimes, we don’t want that to be displayed. To hide the title bar, we can change the layout of the page itself.

 

#Connect to SharePoint Online site
$SiteURL = "https://sppalsmvp.sharepoint.com/sites/ReactRepository/"
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 "13" -Values @{"PageLayoutType"="Home"}

Then, the title bar will not appear on this layout.

Happy Coding
Sathish Nadarajan

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Leave a comment