How to remove SharePoint Online Modern Page Title using PowerShell

In this tutorial, we will discuss how to remove SharePoint Online Modern Page Title using PowerShell. SharePoint Online modern page remove title can be easily done by using SharePoint Online management shell.

If you are new to SharePoint Online modern experience, you can read What is SharePoint Online Modern Experience.

Out of the box, As I know there is no option in SharePoint Online to hide modern site pages title. So after a few more RND, I got an option to delete the page Title using PowerShell (management shell).

SharePoint Online modern page remove title

If you have not installed the management shell, then you can download and install SharePoint Online Management Shell. You can install a Windows 10 machine also.

Let us first see how to create a modern SharePoint Online site page.

Step-1: Login to the SharePoint Online site -> Go to site Contents -> Site Pages -> Create a New page

sharepoint online modern page remove title

Step-2: Next go to the start menu in your computer and search SharePoint online Management shell -> copy and paste the below script inside the management studio and click on enter.

You can also run the script in Windows PowerShell ISE.

$PageName = "HidePageTitle"
$LoginUrl = "https://pikasha12.sharepoint.com/sites/Blogs"

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

It looks like below:

How to remove SharePoint Online Modern Page Title using PowerShell

Step-3: Once you click on enter, it will take some time to execute the script and you will get the below message.

sharepoint online modern page remove title

Step-4: Now when you will open your SharePoint Online site page, you will not see the page title. The SharePoint Online modern page title has been removed.

remove title from sharepoint modern page

Remove title from all SharePoint modern pages

The above script will remove the title from one specific SharePoint modern page.

If you want to remove the page title from all the SharePoint Online modern pages, then you can run the below PowerShell script.

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

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

After the script executed successfully, it will remove the page title from all the modern SharePoint site pages.

You may like following SharePoint tutorials:

In this SharePoint tutorial, we discussed how to remove SharePoint Online Modern Page Title using PowerShell. Also, we discussed, how to remove modern page title from all the pages in SharePoint Online.

  • I only get errors:

    Connect-PnPOnline : The term ‘Connect-PnPOnline’ is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
    again.
    At line:4 char:1
    + Connect-PnPOnline -Url $LoginUrl -UseWebLogin
    + ~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Connect-PnPOnline:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    Set-PnPClientSidePage : The term ‘Set-PnPClientSidePage’ is not recognized as the name of a cmdlet, function, script
    file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
    and try again.
    At line:5 char:1
    + Set-PnPClientSidePage -Identity $PageName -LayoutType Home
    + ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Set-PnPClientSidePage:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

  • >