Deleted File Recovery

Fix Remove-SPOSite Command Deleting SharePoint Site Instead of Redirect

Emma BrownEmma Brown Oct 23, 2026 869 views

Question details

The user needs to recover a SharePoint site that was accidentally deleted when running the Remove-SPOSite command intended only to remove a redirect URL.

Fix Remove-SPOSite Command Deleting SharePoint Site Instead of Redirect
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Removing an old SharePoint redirect URL using PowerShell commands.
Observed behavior
The Remove-SPOSite command deleted the actual SharePoint site, and neither the target site nor the redirect appears in the Get-SPODeletedSite recycle bin list.
Before you start

Ensure you have SharePoint Administrator privileges in Microsoft 365 and have the latest version of the SharePoint Online Management Shell installed before proceeding.

Solution 1Recommended

Verify the Deleted Site and Remaining Redirects via PowerShell

Confirm whether the site is genuinely deleted or just missing from the active list by querying the SharePoint recycle bin.

Normally, removing a redirect site using Remove-SPOSite should place it in the recycle bin. Checking the deleted sites list helps determine if the site can be restored manually.

1
Connect to SharePoint Online

Open the SharePoint Online Management Shell and connect to your admin center using the command: Connect-SPOService -Url https://<tenant>-admin.sharepoint.com

2
Check remaining redirects

Run the command 'Get-SPOSite -Template REDIRECTSITE#0' to verify if the intended redirect was actually removed or if others remain.

3
List deleted sites

Run 'Get-SPODeletedSite' to check if your deleted site collection is present in the recycle bin.

4
Restore the site

If the site appears in the deleted list, use 'Restore-SPODeletedSite -Identity <URL>' to recover it to its active state.

Verify the Deleted Site and Remaining Redirects via PowerShell
Command Syntax: Make sure you use 'Get-SPODeletedSite' and not 'Get-SPDeletedSite', as the latter is for on-premises SharePoint and will return an error in SharePoint Online.
Free Microsoft Office alternative

Switch to WPS Office for a Lightweight Document Experience

While Microsoft 365 and SharePoint handle enterprise backend site management, you need a reliable, hassle-free suite for your daily document workflows. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office for creating, editing, and managing Word, Excel, and PDF files seamlessly.

  1. 1. Download the Installer: Visit the official WPS Office website and download the free installation package.
  2. 2. Install the Suite: Run the installer and follow the simple on-screen instructions to set up the software.
  3. 3. Open Your Documents: Launch WPS Office and instantly open your existing Microsoft Office files without losing formatting.
Fully compatible with Microsoft Office formats including DOCX, XLSX, and PPTX.Lightweight architecture that consumes significantly fewer system resources.Familiar, tabbed user interface ensuring a seamless migration with zero learning curve.Built-in robust PDF editing and conversion tools at no extra cost.
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the 'Get-SPDeletedSite' command work in my PowerShell?

The correct cmdlet for SharePoint Online is 'Get-SPODeletedSite'. The command 'Get-SPDeletedSite' is intended for on-premises SharePoint Server environments and will return a 'not recognized' error if used in the SharePoint Online Management Shell.

How long are deleted SharePoint sites kept in the recycle bin?

Deleted SharePoint site collections are typically retained in the SharePoint recycle bin for 93 days. During this window, administrators can restore them using the 'Restore-SPODeletedSite' command before they are permanently purged.

Can removing a redirect URL permanently delete the target site?

Under normal circumstances, deleting a redirect site (which uses the template REDIRECTSITE#0) only removes the redirect pointer. If the target site is deleted alongside it and bypasses the recycle bin, it is a system anomaly that requires Microsoft backend support to resolve.