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.

13 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
  4. Anton Thorn said:

    Thanks, David!

    April 15, 2020
    Reply
  5. Gowri Sankar Pokuri said:

    Thanks a lot

    June 2, 2020
    Reply
  6. Bharath R Seelam said:

    I am looking to have banner but hide tittle on the banner. Can you please help ?

    September 14, 2020
    Reply
    • David Ramalho said:

      Hi,

      Unfortunately, there is no option to make this type of customization. If you want to have something similar add the image webpart to the top of the page and hide the banner area. This may work for your scenario.

      My best,
      David Ramalho

      September 18, 2020
      Reply
  7. Yerlan said:

    Hi David. It’s useful, very thanks.
    My issue is, to do logo and title not clickable or edit url to another site. How can I do it?
    I have SP modern site

    September 29, 2020
    Reply
    • David Ramalho said:

      Hi,

      Unfortunately, it’s not possible to change the site logo URL on Modern sites.
      My best,
      David Ramalho

      September 29, 2020
      Reply
  8. Gonçalo Moreira said:

    Hello, i’m getting an error

    the url is this:
    https://mydomain.sharepoint.com/sites/intraPol/SitePages/Find%20Me/Find-Me.aspx

    i get this error
    Set-PnPClientSidePage : Cannot contact site at the specified URL
    https://mydomain.sharepoint.com/sites/intrapol/sitepages. There is no Web named
    “/sites/intrapol/sitepages/_vti_bin/sites.asmx”.
    At line:5 char:1
    + Set-PnPClientSidePage -Identity $PageName -LayoutType Home
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (:) [Set-PnPClientSidePage], ClientRequestException
    + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.ClientSidePages.SetClientSidePage

    April 21, 2021
    Reply

Leave a Reply

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