M365 – Remove Page Header or Image Banner From SharePoint Online Pages

Updating SharePoint Online page layout
Updating SharePoint Online page layout

Hi Everyone,

Recently I was working on SharePoint Online project and needed creation of some site pages in the site. So, I started creating pages but SharePoint creates all the modern pages with page headers or image banner. As shown in the image below.

Image-1 SharePoint Online – SharePoint Site Modern Page With Page Header

There is a way to remove the page header using pnp powershell. Let’s see how it can be done. We will connect to SharePoint online -> list out all the pages from site pages library -> and change the property “PageLayoutType” of the page which is nothing but the list item.

See below steps:

  1. Open Windows PowerShell ISE.
  2. Run following commands one by one.
  3. Connect to SharePoint Online.
Connect-PnPOnline https://<your-tenant-name>.sharepoint.com/sites/<sitename>

4. Get the list of all pages from Site Pages

Get-PnPListItem -List SitePages
Image-2 SharePoint Online – Get All Site Pages

5. Change the Page Layout from “Article” to “Home”, here replace <List-Item-Id> with the Id of the list item we got in the last step.

Set-PnPListItem -List SitePages –Identity 10 -Values @{"PageLayoutType"="Home"}
Image-3 SharePoint Online – Set The Property Of Page

After this command is executed go back to SharePoint site and refresh the page. The page header or image banner is gone..

Image-4 SharePoint Online – SharePoint Site Modern Page Without Page Header

Thanks a lot for reading.

You may also like...

1 Response

  1. May 5, 2021

    […] Today I am going to write about chrome extension every SharePoint admin and developer must have. I came to know about this extension while I was working on a project. There was a need to change page layout from Article to Home. As I googled it, I found many articles showing how we can do it using PowerShell command. You can see how to do it using PowerShell in my blog here (M365 – Remove Page Header or Image Banner From SharePoint Online Pages). […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading