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?

You may want to change the name of your SharePoint site for many reasons, 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:

  1. Go to Site Settings Page >> Click on the “Title, Description, and Logo” link under “Look and Feel”.
  2. Enter the new title for your site or site collection.change site collection title in sharepoint online using powershell
  3. 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 the 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 the below steps:

  1. Login to the site where you want to change name. Click on Settings gear >> Click on the “Site Information” link. 
  2. 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 also update the Site description 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 the 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"
$NewSiteDescription = "US Team Site"

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

    #change sharepoint online site description
    $web.description = $NewSiteDescription

    $Web.Update()
    $Ctx.ExecuteQuery()
     
    Write-host "Site Title and Description has been updated!" -ForegroundColor Green  
}
Catch {
    write-host -f Red "Error Updating Site Title!" $_.Exception.Message
}

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

SharePoint Online: Change Site Name using PnP PowerShell

Use the PnP PowerShell’s Set-PnPWeb cmdlet to change the 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 site’s description 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 - Information Technology Expert with Two decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. Passionate about sharing the deep technical knowledge and experience to help others, through the real-world articles!

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

  • Hello! Any idea how to change the site name at Sharepoint Portal? I changed my site name at settings, it is showing the correct name on site menu, but it didn’t change on Sharepoint Portal!

    Reply
  • 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

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