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

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.

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