Standardizing Sitecore Item Names and Display Names Using PowerShell
Published: 5 October 2026

Introduction
In large Sitecore implementations, it is common for multiple developers and content authors to contribute to the same content tree. While this accelerates development and content creation, it often introduces inconsistencies in how items are named.
Over time, you may start seeing issues such as:
- Page item names containing spaces instead of hyphens
- Inconsistent naming conventions across items
- Some items having Display Names configured while others do not
- URLs that are not SEO friendly
- A messy and inconsistent content tree
These problems are particularly noticeable when the project approaches delivery. Cleaning up hundreds of items manually becomes time-consuming and error-prone.
A more efficient approach is to automate the process using Sitecore PowerShell Extensions (SPE). With a simple script, we can enforce a consistent naming convention across a specific section of the content tree in just a few seconds.
The Problem
Consider a typical content structure like this:
/sitecore/content/Synapxe/Brand Portal/Home
About Us
Our Services
Brand Identity
BrandGuidelines
media library page
In this scenario:
- Some item names contain spaces
- Some items do not have a Display Name set
- Naming conventions vary depending on who created the item
This leads to inconsistent URLs and an untidy structure.
For example:
Item Name | Display Name | URL |
About Us | About Us | /about-us |
Our Services | (empty) | /our services |
Brand Identity | Brand Identity | /brand identity |
BrandGuidelines | (empty) | /brandguidelines |
media library page | Media Library Page | /media library page |
The goal is to standardize this so that:
- Item names become SEO-friendly URLs
- Display Names become human-readable page titles
The Solution
Using Sitecore PowerShell Extensions, we can create a script that:
- Takes a parent item path as input
- Filters items based on a specific template
- Converts item names into SEO-friendly format
- Generates proper Display Names
- Updates all items in the subtree automatically
This allows teams to synchronize naming conventions across an entire section of the site instantly.
The PowerShell Script
$rootPath = "master:/sitecore/content/Headless-site/site/Home"
$templateId = "{Template-Id }"
$items = Get-ChildItem -Path $rootPath -Recurse |
Where-Object { $_.TemplateID -eq $templateId }
foreach ($item in $items) {
# Convert name to URL friendly
$newName = $item.Name.ToLower() -replace '\s+', '-' -replace '[^a-z0-9\-]', ''
# Convert to display-friendly title case
$displayName = (Get-Culture).TextInfo.ToTitleCase(($newName -replace '-', ' '))
if ($item.Name -ne $newName -or $item["__Display name"] -ne $displayName) {
Write-Host "Updating:" $item.Paths.FullPath
Rename-Item -Path $item.ItemPath -NewName $newName
$updatedItem = Get-Item $item.ItemPath.Replace($item.Name, $newName)
$updatedItem.Editing.BeginEdit()
try {
$updatedItem["__Display name"] = $displayName
$updatedItem.Editing.EndEdit()
}
catch {
$updatedItem.Editing.CancelEdit()
}
}
}
Write-Host "Completed."
How the Script Works
1. Define the Root Path
The script begins by specifying the parent item from which the process should start.
$rootPath = " master:/sitecore/content/Headless-site/site/Home "
All descendant items under this path will be evaluated.
2. Filter Items by Template
To avoid modifying unrelated items such as folders or data sources, the script filters items using a template ID.
$templateId = "{Template-Id }"
This ensures that only relevant page items are processed.
3. Retrieve Items Recursively
The script collects all child items under the specified root path.
Get-ChildItem -Path $rootPath -Recurse
4. Convert Item Names to SEO-Friendly Format
The script standardizes the item name by:
- converting it to lowercase
- replacing spaces with hyphens
- removing special characters
Example:
Brand Identity → brand-identity
Media Library Page → media-library-page
5. Generate a Proper Display Name
The Display Name is generated by converting the URL format back into a readable title.
Example:
brand-identity → Brand Identity
6. Update Only When Necessary
The script checks whether the item name or Display Name needs updating before making changes. This prevents unnecessary edits and improves performance.
Result
Before running the script:
Item Name | Display Name |
Brand Identity | (empty) |
Media Library Page | Media Library Page |
Our Services | (empty) |
After running the script:
Item Name | Display Name |
brand-identity | Brand Identity |
media-library-page | Media Library Page |
our-services | Our Services |
This results in:
- consistent naming conventions
- SEO-friendly URLs
- properly formatted page titles
- a cleaner content tree
Conclusion
Maintaining consistent naming conventions in large Sitecore projects can be challenging, especially when multiple teams contribute to the content structure. Manual cleanup is rarely practical when dealing with hundreds of items.
By using Sitecore PowerShell Extensions, teams can automate this process and standardize item names and Display Names across an entire section of the site within seconds.
This approach not only improves the structure of the content tree but also ensures that the final site is clean, consistent, and ready for client delivery.

Mitesh Patel || Chief Technology Officer (CTO) | ADDACT
Sitecore AI Certified || XMCloud || OrderCloud Certified
Mitesh Patel is the Chief Technology Officer (CTO) at Addact with 12+ years of experience in enterprise CMS, digital experience platforms, and cloud-native application development. He specializes in Sitecore, Contentful, Strapi, Kentico, Umbraco, Contentstack, and .NET, helping organizations build scalable, secure, and future-ready digital solutions through modern CMS, headless architectures, AI-driven experiences, and cloud technologies.