SharePoint Online: How to Change the Site Title (Name) using PowerShell?

Requirement: Change the Site Title in SharePoint Online.

SharePoint Online: How to Change the Name of a Site?

There are many reasons why you may want to change the name of your SharePoint site, like branding. This blog post will walk you through how to change the name of your SharePoint site in Office 365 quickly and easily!

How to change the name of a SharePoint Online site? Well, To change the site collection title in SharePoint Online, follow these steps:

  • Go to Site Settings Page >> Click on the “Title, Description, and Logo” link under “Look and Feel”
  • Enter the new title for your site or site collection
    change site collection title in sharepoint online using powershell
  • Click “OK” to save your changes. That’s it! This changes the site name. Your new site name will be displayed on the home page and in browser tabs. Now, let’s use PowerShell to change site name in SharePoint Online.

How to Change Site Name in Modern SharePoint Online Sites?

Site names are given at the time of creating site collections or subsites. However, If you want to change the site name, follow below steps:

  • Login to the site where you want to change name. Click on Settings gear >> Click on “Site Information” link. 
  • Enter the Site name value and hit Save to change the name to your SharePoint site.
    sharepoint online how to change site name

In the “Site Information” panel, you can update the Site description as well and click on the “Save” button.

PowerShell to Change Site Title in SharePoint Online:

Let’s see the PowerShell script to change the SharePoint Online site name. Here is the PowerShell to change site or site collection title in SharePoint Online.

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

#Variables
$SiteURL="https://Crescent.sharepoint.com/us"
$NewSiteTitle="United States"

Try {
    $Cred= Get-Credential
    $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
 
    #Setup the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Ctx.Credentials = $Credentials

    #Get the Site from URL
    $Web = $Ctx.web
    $Ctx.Load($web)
    $Ctx.ExecuteQuery()
 
    #Get the current site title
    Write-host "Site Title:"$web.title

    #sharepoint online powershell change site title
    $web.title = $NewSiteTitle
    $Web.Update()
    $Ctx.ExecuteQuery()
     
    Write-host "Site Title has been updated to '$NewSiteTitle'" -ForegroundColor Green  
}
Catch {
    write-host -f Red "Error Updating Site Title!" $_.Exception.Message
}

This PowerShell changes the site collection name to a new name.

SharePoint Online: Change Site Name using PnP PowerShell

Here is the PnP PowerShell to change site name in SharePoint Online

#Config Variables
$SiteURL = "https://Crescent.sharepoint.com/Sales"
 
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)

#sharepoint online powershell change site name
Set-PnPWeb -Title "Sales Portal" 

Change SharePoint Online site description using PowerShell
Similarly, you can update the description of the site using the “-Description” parameter.

Set-PnPWeb -Description "Marketing Portal"

To change the site URL in SharePoint Online, use How to change the Site URL in SharePoint Online?

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

One thought on “SharePoint Online: How to Change the Site Title (Name) using PowerShell?

  • Hi Salaudeen,
    I’ve used your PNP code for modern Team site. Works great. I have an issue, that after a period of time the site reverts back to the old name. Any ideas? do i need to change the Active Directory Group name? Perhaps there’s a routine running that resets it back to the group / Exchange / Teams group name? Many thanks for you great site!!! cheers Ronan

    Reply

Leave a Reply