In this post we will explore how to rename SharePoint Online sites and re-use the original URL.
Have you ever changed the name of a SharePoint Online site and tried to re-use the old URL for a new site? If you have you have probably encountered an issue where SharePoint admin center will tell you that URL is still in use. Well this is because the URL is, in fact still in use in the form of a redirect.
In 2019, Microsoft introduced the site rename feature within the SharePoint admin center, which also updated site URLs too. Once a URL is updated for a given site, or moved to a different geo location, or as part of a site swap – a redirect is automatically created to ensure any links that were pointing to the prior URL continue to work.
How to use an old site URL
To use on old site URL you need to run the following PowerShell command. Note: You will need the SharePoint administrator role to run this command:
- Open the SharePoint Online Management Shell and run the following command:
Connect-SPOService -Url https://[TENANT]-admin.sharepoint.com Remove-SPOSite -Identity https://contoso.sharepoint.com/sites/OldSiteName
- Confirm you want to delete the redirect
Check your URL has been deleted by trying to browse the URL, if you get a 404 error it has been successful.
The Remove-SPO site command is actually defined as “Sends a SharePoint Online site collection to the SharePoint Online Recycle Bin” in the Microsoft documentation reference guide.
Microsoft documentation says that a redirect template (Template type: REDIRECTSITE#0) is applied when the site URL is updated, which contains special headers and logic to redirect your browser requests to the new site.