Forum Discussion
techie1s
Jun 05, 2018Brass Contributor
Reusing a Deleted SharePoint Site Name
QUESTION: Can a new site be created with the same name of a deleted site?
SCENARIO: Today I deleted a SharePoint Team Site (O365) that I created yesterday. Now I want to create a SharePoint Communications Site with the same URL (name) as the SharePoint Team Site that I deleted. (For example: https://company365.sharepoint.com/sites/CompanyNews)
ISSUE: I tried creating it but it placed a "2" after the site name in the URL (For example: https://company365.sharepoint.com/sites/CompanyNews2). I will try deleting the site via Powershell since I only deleted the site by going to Site Information > Delete Site. I just wonder if the name will then become available.
Any thoughts?
Similarly, you can permanently remove the deleted site using Remove-SPODeletedSite cmdlet.
- Thiraviam5316Brass Contributor
techie1s To reuse a deleted SharePoint URL for a new site, there are different considerations based on the time elapsed from the date of deletion. If the site is within the 93-day period from the date of deletion, you need to permanently delete it before creating a new site with the same URL. To permanently delete a SharePoint site, use the following cmdlet:
Remove-SPODeletedSite -Identity <SPOSiteURL>
However, if the site has exceeded the 93-day period from the date of deletion, you can simply create a new site using the existing URL without the need for permanent deletion. For further details on managing deleted sites, check: https://m365scripts.com/sharepoint-online/manage-deleted-sharepoint-sites-using-powershell/
Thiraviam5316 techie1s mattchowell
Here are the scripts for permanently deleting the SharePoint online sites from your tenant using SharePoint Online PowerShell, PnP PowerShell and CLI for Microsoft 365: Empty the tenant recycle bin
Please consider giving a Like if my post helped you in any way.
- seedmeCopper ContributorIf you have admin permission, you can manipulate with the new Sharepoint Admin page to
1. restore the site you have deleted
2. update its url to something different than the desired, e.g. CompanyNews-deleted
then CompanyNews become available again
https://learn.microsoft.com/en-us/sharepoint/restore-deleted-site-collection - AlanCoulterOzCopper Contributor
techie1s I found that even after removing the deleted site from the recycle bin, even after a few days I still could not create the site using the original URL (i.e. it appends a '2' on the end of the URL when you try to use the original URL). Even when using New-PnPSite, the URL returned had the 2 on the end.
To fix it however, I was then able to do a Connect-SPOService -Url <tenantadminurl>, then run the Start-SPOSiteRename command.
Syntax: Start-SPOSiteRename -Identity <newsiteurl> -NewSiteUrl <originalsiteurl>
- Tim MillerCopper Contributor
This appears to still be an issue. I deleted a site and am looking to recreate with a different template. the Get-SPODeletedSites commandlet comes back clear with no deleted sites found. the site does not show in the Get-SPOSites either. The site was deleted and removed in PowerShell.
Trying to recreate the site it allows the same site name but puts a 2 on the site name for the URL. Is there a database that needs cleared for the URL to be reused?
- jfranzBrass Contributor
Tim Miller Sounds like you are having the same issue I was except I used the Central Admin console. My understanding is if you delete a site it goes into the site administration recycle bin where it sits for 30 days. You can force it to delete which would free up the old URL to be reused but it sounds like it is still in your site collection recycle bin but you aren't seeing it. Wondering if it is still a problem or if it cleared after some time? If you go into the Central admin and go to deleted sites do you see anything there? My understanding is once it's cleared from that site admin recycle bin that's it, it should be clear.
- Tim MillerCopper Contributor
jfranz I have used both powershell and admin console.
In PowerShell running Get-SPOSite and Get-SPODeletedSite, both outputs do not have the site listed so there is nothing to Remove-SPODeletedSite on. I have also tried the Clear-PnPTenantRecycleBin wich came up with nothing as well.
In the Admin console the site does not show in the active or deleted sites lists.
to the best i can see the site is deleted and gone but I still get the "2" on the URL when recreating the site. is there a database that the URL is stored in and a PS command to remove it maybe? im at a loss
- mattchowellIron ContributorThe right answer!
- mattchowellIron Contributor
Actually I realize now that's not always the right answer...Msft has made such a hash job of site deletion that sometimes even if you "permanently delete" a site from SP admin deleted sites page, you still can't reuse its url. It just happened to me so in that scenario you still need powershell:
Connect-SPOService -Url https://xxx-admin.sharepoint.com
Remove-SPOSite -Identity https://xxx.sharepoint.com/sites/deletedsite
- Manidurai MohanamariappanIron Contributor
Similarly, you can permanently remove the deleted site using Remove-SPODeletedSite cmdlet.
- Setayesh2Copper Contributor
I had the same problem. Created a team site but wanted to free up the name and create a communication site. I first changed the name to 'site2' but couldn't use the name so deleted the site through the suggestion in this topic. but still cannot use the name for the new site.
Anyone can advise?
- Peter_MorrisCopper Contributor
Do you have to wait any length of time to be able to reuse the URL? I've removed a site using the Remove-SPODeletedSite command but it still wants to create a URL with a 2 on the end.
It was a classic site, I removed it, waited 29 days for it to disappear. Saw it in the recycle bin on the NEW SharePoint Admin centre, deleted it from there, then ran the Remove-SPODeletedSite command. It is gone. I can't find it anywhere but when I try to create the site again (in a Modern stylie), it puts a 2 on the end.
Hence my question. To I have to wait a certain length of time.
Peter
I'm a SharePoint Admin only
- Manidurai MohanamariappanIron Contributor
I have checked my tenant is working fine, so i can able to create new site with old name with in 2 minutes. can you please check Get-SPODeletedSite it will returns all deleted site collections from the Recycle Bin.
- techie1sBrass Contributor
Thank you for taking the time to reply! This worked perfectly!!!
- Devendra VelegandlaBrass Contributor
techie1s After manually deleting the site collection, the site collection will be at Tenant Recycle bin but you willn't be able to delete manually. You can use below commandlet to delete it.
Clear-PnPTenantRecycleBinItem -url <https://spjourney.sharepoint.com/sites/companynews>
Once you delete from RecycleBin then the URL will be available.
- techie1sBrass Contributor
Thank you so much! This was invaluable feedback!