Deleting a SharePoint site removes it from the Recycle Bin, but its URL usually isn't reusable until it's permanently purged. This most often comes up when rebuilding a site from scratch under the same address, or fully decommissioning a project or team site.
There are two ways to approach this — and the difference between them matters a lot if you make a mistake.
Remove-SPOSite
Remove-UnifiedGroup
Remove-SPODeletedSite
Confirm you're targeting the right site and see whether it's connected to a Microsoft 365 Group (a non-empty GroupId means it is):
GroupId
Connect-SPOService -Url "https://<your-tenant-name>-admin.sharepoint.com" Get-SPOSite -Identity "https://<your-tenant-name>.sharepoint.com/sites/YourSiteName" | Select-Object Url, Title, Template, GroupId, Status
This moves the site to the Recycle Bin. The URL is not released yet, but the site is fully recoverable during the retention window (93 days by default) if you change your mind:
$SiteUrl = "https://<your-tenant-name>.sharepoint.com/sites/YourSiteName" Remove-SPOSite -Identity $SiteUrl -Confirm:$false Write-Host "Site sent to Recycle Bin: $SiteUrl"
Changed your mind? Restore it before the retention window expires:
Restore-SPODeletedSite -Identity $SiteUrl
Only do this once you're certain you no longer need the site or its content. This purges the site from the Recycle Bin immediately, making the URL available for reuse right away:
$AdminUrl = "https://<your-tenant-name>-admin.sharepoint.com" $SiteUrl = "https://<your-tenant-name>.sharepoint.com/sites/YourSiteName" Connect-SPOService -Url $AdminUrl # Step 1: Soft-delete the site (skip if already done via Method 1) Remove-SPOSite -Identity $SiteUrl -Confirm:$false # Step 2: Permanently purge it from the Recycle Bin, releasing the URL Remove-SPODeletedSite -Identity $SiteUrl -Confirm:$false Write-Host "Site permanently deleted and URL released: $SiteUrl"
Replace <your-tenant-name> and YourSiteName with your actual tenant name and site name before running.
<your-tenant-name>
YourSiteName
When using any software or code, it is important to remember that there is always a certain level of risk involved. As a user, you are responsible for ensuring that the software or code you are using is suitable for your needs and that you are aware of any potential risks associated with its use.
If you are considering using any code or software provided by ITMS, we advise you to review our terms of service at https://www.itms-us.com/Website-Terms-Of-Use.
Any code provided by ITMS is provided "as is," without warranties or guarantees. By using our code, you acknowledge and accept the risks associated with its use and agree to hold ITMS harmless for any damages or losses that may result.
From SharePoint governance to full tenant management, IT Master Services keeps your Microsoft 365 environment clean, secure, and running the way it should.