How to Remove a Redirect Site in SharePoint Online?

Problem: When you edit the URL of an existing SharePoint Online site, it automatically creates a new redirect from the old site to the new site. So, You can’t use the old site URL for new sites as there is an existing redirect site with the old URL already in place!

sharepoint online delete redirect site

Delete Redirect site in SharePoint Online

So, we have to remove the redirect site to utilize the old URL, as SharePoint doesn’t allow us to reuse the old URL. The Admin center displays the “This site address is available with modification.” message. Here is how to delete the redirect site in SharePoint Online:

#Connect to SharePoint Online Admin Center
Connect-SPOService https://crescent-admin.sharepoint.com/

#Remove the Redirect site
Remove-SPOSite -Identity https://crescent.sharepoint.com/sites/Compliance

You can retrieve the list of all redirect sites using:

Get-SPOSite -Template REDIRECTSITE#0

More info on managing redirect sites in SharePoint Online: https://docs.microsoft.com/en-us/sharepoint/manage-site-redirects

PnP PowerShell to Remove a Site Redirect

Redirect sites can be useful for enhancing user experience, but some times you need to remove them to clean up your environment or reuse the URL. Using PnP PowerShell you can delete any redirect sites.

#Parameters
$TenantAdminUrl = "https://crescent-admin.sharepoint.com"
$RedirectSiteURL = "https://crescent.sharepoint.com/sites/ProjectX"

#Connect to Admin Center
Connect-PnPOnline -Url $TenantAdminUrl -UseWebLogin

#Remove the Redirect site
Remove-PnPTenantSite -Url $RedirectSiteURL -Force

#Verify all redirect sites
Get-PnPTenantSite -Template "RedirectSite#0"

Similarly, to remove all redirect sites in SharePoint Online, use:

#To remove all redirect sites, use:
$RedirectSites = Get-PnPTenantSite -Template "RedirectSite#0"

ForEach ($Site in $RedirectSites) {
    Remove-PnPTenantSite -Url $site.Url -Force
}

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

3 thoughts on “How to Remove a Redirect Site in SharePoint Online?

  • What if you want to save the oldsite? How do you remove the redirect and save the old site?

    Reply
  • Hi, I get this error. Could you please help? I have removed the lock to see if that was the issue but still the same.

    Remove-SPOSite : The requested operation is not supported for site:

    Reply
    • Thid could be because the site is included in an eDiscovery hold or retention policy that is blocking deletion.

      Reply

Leave a Reply

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