Skip to content
All articlesSharePoint

How to Restore a Deleted SharePoint Site (Admin Center, PowerShell)

How to restore a deleted SharePoint site: the Deleted sites page, Restore-SPODeletedSite, the 93-day window, group-connected sites, subsites and the root site.

18 Nov 202614 min read
How to Restore a Deleted SharePoint Site (Admin Center, PowerShell)

How to restore a deleted SharePoint site

A SharePoint Administrator restores a deleted site from the Deleted sites page in the SharePoint admin center: select the site, then select Restore. Microsoft keeps deleted SharePoint sites for 93 days. After 93 days, sites and all their content and settings are permanently deleted, including lists, libraries, pages and any subsites.

Where you restore from depends on what was deleted:

What was deletedWhere it is keptHow longWho restores it
A site (previously called a site collection)Deleted sites in the SharePoint admin center93 daysA SharePoint Administrator or above
A site that belongs to a Microsoft 365 group, including a team in TeamsDeleted sites for the site, Deleted groups in the Microsoft 365 admin center for the group93 days for the site, 30 days for the other group resourcesA SharePoint Administrator for the site; a groups administrator or the group's owner for the group
A subsiteThe second-stage recycle bin of the site it was in93 days from the time it was deleted, unless it is removed soonerA site collection administrator
The root siteDeleted sites in the SharePoint admin center93 daysA SharePoint Administrator, who then replaces the root site

Restore a site in the SharePoint admin center

Microsoft states that in the SharePoint admin center you can delete and restore all the new types of sites with the permissions of a SharePoint Administrator or more in Microsoft 365.

  1. Go to Deleted sites in the SharePoint admin center and sign in with an account that has admin permissions for your organization.
  2. Select the site you want to restore.
  3. Select Restore.

Two details from Microsoft's page save time:

  • The Restore button needs a single selection. If you don't see Restore, make sure only one site is selected. The button does not appear when multiple sites are selected.
  • The list can be sorted and filtered. You can sort and filter deleted sites the same way as on the Active sites page, and also by Time deleted, which is the quickest way to find a site that went recently.

SharePoint admin center covers the address of the admin center, who can sign in and what each section does.

Restore a site with PowerShell

The SharePoint Online Management Shell has a cmdlet for each step: Get-SPODeletedSite lists what can be restored and Restore-SPODeletedSite restores it.

  1. Download the latest SharePoint Online Management Shell. If you installed a previous version, Microsoft says to go to Add or remove programs and uninstall "SharePoint Online Management Shell" first.
  2. Connect to SharePoint Online. Microsoft's reference for Restore-SPODeletedSite says you must be at least a SharePoint administrator to run it.
Connect-SPOService -Url https://contoso-admin.sharepoint.com
  1. List the deleted sites. Microsoft describes this cmdlet as returning all deleted site collections from the Recycle Bin. It only returns their properties and does not restore anything.
Get-SPODeletedSite
  1. Restore the site by its URL.
Restore-SPODeletedSite -Identity https://contoso.sharepoint.com/sites/arecycledsite

Microsoft's reference adds that to restore the sites that Get-SPODeletedSite returns, you forward the results to Restore-SPODeletedSite in the pipeline. To run Get-SPODeletedSite, it says you must be a SharePoint Online administrator and a site collection administrator for the deleted site collections.

The parameters

CmdletParameterWhat Microsoft's reference says
Restore-SPODeletedSite-IdentityRequired. "Specifies the URL of the site collection to restore."
Restore-SPODeletedSite-NoWaitOptional. "Specifies to continue executing script immediately."
Get-SPODeletedSite-IdentityOptional. "Specifies the URL of the deleted site collection to be returned."
Get-SPODeletedSite-LimitOptional. The maximum number of site collections to return. "To retrieve all site collections, use ALL. The default value is 200."
Get-SPODeletedSite-IncludePersonalSiteOptional. Includes Personal Sites in the results. By default the cmdlet returns only sites that are not Personal Sites (My Sites).
Get-SPODeletedSite-IncludeOnlyPersonalSiteReturns only Personal Sites. It is in a different parameter set from -IncludePersonalSite, so you can use one or the other and not both.

In a tenant with more than 200 deleted sites, use Get-SPODeletedSite -Limit ALL so the site you want is not cut off by the default. Connect-SPOService: connect to SharePoint Online with PowerShell covers the sign-in options.

A site that belongs to a Microsoft 365 group

A team site created with a Microsoft 365 group, or the site behind a team in Microsoft Teams, is tied to that group. Microsoft says deleting one of these sites deletes the group and all its resources, including the Outlook mailbox and calendar and any Teams channels. Restoring works the same way in reverse: "Restoring a site that belongs to a Microsoft 365 group restores the Microsoft 365 group and all its resources."

The two clocks are different. Microsoft states that the other group resources are retained for only 30 days, whereas the site is retained for 93. Its page on restoring groups says that after 30 days the group and its associated contents are permanently deleted and can't be restored. To get the mailbox, calendar and Teams channels back along with the site, restore inside the first 30 days.

Restore the group

Microsoft documents two ways to restore a deleted Microsoft 365 group.

The group's owner, in Outlook on the web:

  1. On the deleted groups page, select the Manage groups option under the Groups node, and then choose Deleted.
  2. Select the Restore tab next to the group you want to restore.

If the deleted group does not appear there, Microsoft says to contact an administrator.

A groups administrator, in the Microsoft 365 admin center:

  1. Go to the Microsoft 365 admin center and sign in.
  2. Expand Groups, and then select Deleted groups.
  3. Select the group that you want to restore, and then select Restore group.

When a group is restored, Microsoft lists this content as restored with it:

  • the Microsoft Entra Microsoft 365 Groups object, its properties and members
  • the group's e-mail addresses
  • the Exchange Online shared Inbox and calendar
  • the SharePoint Online team site and files
  • the OneNote notebook
  • Planner
  • Teams
  • the Viva Engage group and group content, if the group was created from Viva Engage
  • the Power BI Classic workspace

Microsoft notes that in some cases it can take as long as 24 hours for the group and all of its data to be restored, and that you should wait at least one hour after restoring before sending email to the group, because messages sent immediately may fail with a non-delivery report.

When the other group resources have gone

For a group-connected site whose other group resources have already been deleted, Microsoft's page notes that you can use the PowerShell command Remove-SPODeletedSite to permanently delete the site. How to delete a SharePoint site covers permanent deletion and what it does to the site's URL.

Restore a deleted subsite

The Deleted sites page lists sites, which Microsoft previously called site collections. A subsite deleted from inside a site is kept somewhere else. Microsoft states: "Web items (subsites) go directly to the second-stage Recycle Bin and still count toward the storage-used metric. The quota is returned when the web items are purged from the second-stage Recycle Bin."

Microsoft says you need administrator or owner permissions to use the site collection Recycle Bin, and that a SharePoint site collection administrator can view and restore deleted items from it to their original locations. Its steps for the second-stage recycle bin are:

  1. In the site that contained the subsite, select Recycle bin in the left pane. This applies to modern team sites and classic sites. On modern communication sites, select Site contents, and then select Recycle bin in the top navigation bar.
  2. If you don't see the Recycle Bin, select Settings and then Site settings. If you don't see Site settings, select Site information and then View all site settings. Under Site Collection Administration, select Recycle bin.
  3. At the bottom of the Recycle Bin page, select second-stage recycle bin.
  4. Point to the items you want to restore, select the check icon to the right of each one, and then select Restore.

Microsoft's retention rule for SharePoint in Microsoft 365 is that items are retained for 93 days from the time you delete them from their original location. Two things can remove an item from the site collection Recycle Bin sooner: the bin exceeds its quota and starts purging the oldest items, or the site collection administrator deletes the item manually.

SharePoint recycle bin: how to recover deleted files explains the two stages for files and folders, and What is a SharePoint site collection? explains how sites and subsites relate.

Restore the root site

Microsoft recommends against deleting the root site, because all your SharePoint sites are inaccessible until you restore it or create a new root site. If it has been deleted, Microsoft's troubleshooting guidance is a two-part job: "you'll have to first restore the site and then replace it by using the steps in Replace your root site." Restore it from Deleted sites as above, then follow Microsoft's Replace your root site steps.

When the first sign is "Error 404"

A deleted site is often noticed by the people who use it before an administrator is told. Microsoft's troubleshooting article "Error 404 File/Page not found in OneDrive or SharePoint" says the error occurs because the site, file or group was renamed, moved or deleted. Its action for administrators is: "The site might have been deleted. If so, restore the deleted site from the new SharePoint admin center."

  1. Go to the Deleted sites page.
  2. Select the site to restore.
  3. Select Restore.

If the site is not in Deleted sites, check whether it was renamed. How to rename a SharePoint site covers what changing a site's address does.

After 93 days

After 93 days the site is permanently deleted with its content and settings. A site is also gone from the list sooner if an administrator permanently deleted it from the Deleted sites page or with Remove-SPODeletedSite, which Microsoft describes as permanently removing a deleted site collection from the Recycle Bin.

Microsoft documents one further route, and what your organization can set up in advance:

  • A restore by Microsoft Support. Microsoft states: "SharePoint Online retains backups of all content for 14 additional days beyond actual deletion." If content can't be restored through the Recycle Bin, an administrator can contact Microsoft Support to request a restore at any time inside the 14-day window. Microsoft says restorations from backups can only be completed for site collections, not for specific files, lists or libraries, and that for safety and security reasons these restores can only be performed to a new URL.
  • A retention policy. Microsoft's restore page notes that if you need to retain content for a minimum period to comply with industry regulations or internal policies, you can create a retention policy to keep a copy of it in the Preservation Hold library. The Preservation Hold Library explains what that library holds.
  • Microsoft 365 Backup. Microsoft notes that customers also have the option to use Microsoft 365 Backup for data recovery. Microsoft 365 Backup explains what it covers.

Deleted sites and your storage figure

Microsoft states that deleted sites in the Recycle Bin do not count toward the organization's total storage usage, and that it takes up to 48 hours for the storage usage to update. Check the figure before you restore a large site into a tenant that is close to its limit. SharePoint sites read-only because storage is full covers what happens at the limit.

Sites are often deleted to bring that figure down and restored when someone needs a file from them. There are two ways to free the space and keep the content within reach:

  • Archive the whole site. Microsoft 365 Archive moves a site to a cold tier and can reactivate it later.
  • Archive the inactive files and keep the site. Squirrel moves inactive files from document libraries into Azure Blob Storage in your own subscription and leaves a stub with the original name, so the site stays live and a user restores a file in one click.

SharePoint archiving compares every option for files, sites and libraries.

See how Squirrel archives inactive SharePoint files

Frequently asked questions

How long do I have to restore a deleted SharePoint site?

93 days. Microsoft states that deleted SharePoint sites are retained for 93 days, and that after 93 days sites and all their content and settings are permanently deleted, including lists, libraries, pages and any subsites.

Who can restore a deleted SharePoint site?

A SharePoint Administrator, or a role above it, in Microsoft 365. Microsoft's reference for Restore-SPODeletedSite says you must be at least a SharePoint administrator to run the cmdlet.

Where do I find deleted SharePoint sites?

On the Deleted sites page in the SharePoint admin center. The list can be sorted and filtered, including by Time deleted. In PowerShell, Get-SPODeletedSite returns the deleted sites.

Why is there no Restore button on the Deleted sites page?

Microsoft says the button won't appear if multiple sites are selected. Select one site and Restore appears.

What is the PowerShell command to restore a deleted SharePoint site?

Restore-SPODeletedSite -Identity followed by the URL of the site, for example Restore-SPODeletedSite -Identity https://contoso.sharepoint.com/sites/arecycledsite. Connect with Connect-SPOService first.

Does restoring a team site bring back the Microsoft 365 group and the team?

Microsoft states that restoring a site that belongs to a Microsoft 365 group restores the group and all its resources. The other group resources are retained for only 30 days, whereas the site is retained for 93.

How do I restore a deleted SharePoint subsite?

From the second-stage recycle bin of the site it was in. Microsoft states that subsites go directly to the second-stage Recycle Bin. A site collection administrator opens the Recycle bin, selects second-stage recycle bin at the bottom of the page, selects the item and selects Restore.

Can a SharePoint site be restored after 93 days?

Not from Deleted sites. Microsoft states that SharePoint Online retains backups of all content for 14 additional days beyond actual deletion, and that an administrator can contact Microsoft Support to request a restore inside that window. Those restores are for site collections only and are performed to a new URL.

Does a deleted SharePoint site count toward storage?

No. Microsoft states that deleted sites in the Recycle Bin do not count toward the organization's total storage usage, and that the usage figure takes up to 48 hours to update. A deleted subsite is different: it sits in the second-stage Recycle Bin and still counts until it is purged.

Why does Get-SPODeletedSite not show my site?

By default the cmdlet returns up to 200 site collections and leaves out Personal Sites. Use -Limit ALL to retrieve all of them, or -Identity with the site's URL to look for one site.

About the author
Mark Smith - Co-Founder, SmiKar Software

Mark Smith co-founded SmiKar Software in 2015 and has spent the past decade helping organisations solve Microsoft 365 data management challenges. He works with the SmiKar team to build solutions for SharePoint archiving, storage optimisation, governance and compliance, supporting customers from growing businesses through to Fortune 500 enterprises.

More about SmiKar

Ready when you are

Cut your Microsoft 365 storage bill - keep your data in your tenant.