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
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:
Step-3: Once you click on enter, it will take some time to execute the script and you will get the below message.
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 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
}
After the script executed successfully, it will remove the page title from all the modern SharePoint site pages.
You may like following SharePoint tutorials:
- Add Modern SharePoint Site Page in Microsoft Teams
- How to Create a Tiles View using SharePoint Online modern list view customization
- Create user profile card using SharePoint Online modern list view customization using JSON
- SharePoint modern list view customization example
- How to change Listview color using SharePoint Online modern list view customization
- How to create a birthday view using SharePoint Online modern list view customization
- SharePoint Online modern list view customization using JSON Example
- Customize SharePoint Online site header and footer using SPFx Application Customizer
- How to create a SharePoint site in Office 365
- How to perform IIS backup and restore using PowerShell
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.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).
this is not correct (anymore) because it is adding all the content also of a default homepage
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
How do I put the Title Header back if I want to put it back to the way it was?