Remove title header on SharePoint Online

When creating a new page a header with the title of the page will be shown to the user. In the current days, it’s not possible to remove that header from the page using the SharePoint interface. Today, we will share a PowerShell that allows you to remove that area from the page and some article that you can use with different options.

Replace the variable below with your own and you will have a page without the title header.

$PageName = "PageName"
$LoginUrl = "https://contoso.sharepoint.com/sites/siteName"

Connect-PnPOnline -Url $LoginUrl -UseWebLogin
Set-PnPClientSidePage -Identity $PageName -LayoutType Home

If you intend to remove from all the SitePages use this code, but before you do to all of the Site Pages, I would recommend making some backup. You can use the approach of this article for this.

$LoginUrl = "https://contoso.sharepoint.com/sites/siteName"
Connect-PnPOnline -Url $LoginUrl -UseWebLogin

$pages = (Get-PnPListItem -List SitePages).FieldValues
foreach($page in $pages){
    Set-PnPClientSidePage -Identity $page.FileLeafRef -LayoutType Home
}

Conclusion

This is a possible approach for this case but there are other possibilities to achieve. Check below link (techmikael) to create an option inside SharePoint to have this option inside the properties of the page. There is also an extension for Google Chrome (Chrome-SP-Editor) which you can use to remove this option. The option used for that case is instead of using the option to remove the header, they use the Page Layout Home.

5 Comments

  1. Robert Moses said:

    Useful info. Thanks David!

    September 17, 2019
    Reply
  2. Sebastian Rogers said:

    This can now be achieved by using a PnP Provisoning template

    the key is the Layout=”Home” attribute

    January 2, 2020
    Reply
  3. Niclas said:

    How would you go about if you would like to reverse this? I have a case where the header area is gone (don’t know how) and I want to put it back.

    January 14, 2020
    Reply
    • David Ramalho said:

      Hi Niclas,

      In the PowerShell script, you just need to change the layout from Home to Article. If you switch to repost, it’ll clear all the web parts on the page so be careful with this change.
      Set-PnPClientSidePage -Identity $PageName -LayoutType Article

      January 14, 2020
      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *