Remove Header Image Banner From SharePoint Modern Pages

SharePoint Online Modern pages have header image banners in all modern pages;  i.e., Communication or Team Sites. Header image banner needs a background image or text, it takes almost 40% of the page, and we can’t remove this section using User Interface.






If you want to turn this section ON or OFF, it is possible using PnP PowerShell command. Basically, it allows us to change the page layout from Article to Home. The homepage layout doesn’t have a header image banner section.
Remove the Header Image Banner Section
Open SharePoint Online Management Shell and run the below command in sequence.
  1. # Connect to the site  
  2. Connect-PnPOnline https://mittal1201.sharepoint.com/sites/teamsite  
  3. # List all pages, and find the id of the modern page  
  4. Get-PnPListItem -List SitePages  
  5. # Change layout from "Article" to "Home" to remove top banner  
  6. Set-PnPListItem -List SitePages –Identity <id> -Values @{"PageLayoutType"="Home"

Screenshot for your reference.


After executing this command, refresh the page. You will not find the header image banner.


Happy Coding.

3 comments:

  1. Does your blog have a contact page? I'm having trouble locating it but, I'd like to send you an e-mail. I've got some ideas for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it expand over time.

    ReplyDelete
  2. Pretty nice post. I just stumbled upon your weblog and wished to say that I have really enjoyed surfing around your blog posts. In any case I'll be subscribing to your feed and I hope you write again soon!

    ReplyDelete
  3. We are a group of volunteers and opening a brand new scheme in our community. Your website offered us with helpful info to work on. You have done a formidable task and our entire group will be grateful to you.

    ReplyDelete