Let me explain SharePoint...

Don’t remove the root web of your classic SharePoint Site Collection!

This post was most recently updated on March 25th, 2023.

4 min read.

A quick heads-up – if you remove the root site (or RootWeb, like it’s called in the code) of your classic SharePoint Site Collection, that’s going to cause you some grey hairs. It might even, in some rare cases, be unrecoverable! The following post describes what kind of issues you might run into, if you remove the root web instead of the whole site collection, and how to remove the site collection instead.


Update 13.7.2019:
SharePoint Online keeps evolving, and at least on some tenants, removing the root web of the site collection now also removes the site collection. This means that the whole removed site collection is in fact recoverable (if everything goes right) by accessing the classic recycle bin and using it to restore the site. You can get there by using the following path:

admin center -> show all > sharepoint -> classic features -> classic site collection page -> Recycle bin

The warning message now reflects this as well:

Site removal view now describes the whole site collection getting removed in case you remove the root web. This is a new (or rather, restored) behavior in SharePoint Online.
The site removal view now describes the whole site collection getting removed in case you remove the root web. This is a new (or rather, restored) behaviour in SharePoint Online.

Thanks, Sanjin for the heads-up in the comments section!

Since this seems to be another gradual change and could be rolled back, I’m leaving the original post up as well – see all of that below.


Whereas you can always restore a normal site from the site collection recycle bin, you the root site can’t. You actually can’t access the recycle bin after removing the root site, nor can you make magic happen with PowerShell commandlets anymore.

Site Collection Recycle Bin
Site Collection Recycle Bin – where you could access your removed sites, if you still had the root site!

The Recycle Bin would be located at a URL like this: https://[your_site_url]/_layouts/15/AdminRecycleBin.aspx, but after the site is removed, it won’t be there.

If you actually just wanted to get rid of your site collection by removing the site (see below), in SharePoint Online, you’re out of luck again. Removing a root site (or a root web, as you can also call it) from a SharePoint Site collection seems to be a weird “worst-of-both-worlds” kind of action – you can’t administer or even access the site collection anymore, but you can’t restore it through the UI either (it doesn’t show as removed in SharePoint Online’s site collection listing, or in “Deleted sites” in the new Admin Center!

Basically, you now still have the site collection, just without any sites in it. You can’t even reuse the URL for anything, as it’s still reserved for your site collection!

I actually managed to get into an unrecoverable state by doing this and tried to recover the site I removed. That didn’t go well! See this post for a cautionary tale about relying on the backups after Restore-SPODeletedSite got stuck:

Okay – so what are the steps I should never take?

Browse to root site > Site Settings > Site Actions > Delete this site

"Delete this site" on SharePoint Online
“Delete this site” on SharePoint Online

It will say this (see below), which is technically true but doesn’t help us much…

SharePoint Online Site Collection Recycle Bin
SharePoint Online Site Collection removal – Removing the root site means it’ll end up in the Recycle Bin, but it’s not accessible for you anymore, so this is not really helpful.

In SharePoint 2013, the action of removing the root site was apparently functionally equivalent to removing the site collection (see this blog post for more info). There this functionality made more sense – the site collection can be restored from the second-level recycle bin.

But this is not true for SharePoint Online.

Wait – I want my site back!

Whoops, weren’t you actually supposed to remove that site? And now you’re in trouble since you can’t restore it from anywhere? No worries – happens to the best of us!

At least for me, the good old “Restore-SPODeletedSite” did nothing. It can (usually) restore site collections, but didn’t seem to have much success with a root site. You can still try it, but for me it just hung and never finished. Or you might just get an empty root site back (without any of your content or customizations) – that seems to happen every now and then!

If you want to get your site back and you’re on SharePoint Online, you need to move fast. Microsoft stores 14 days’ worth of backups for your site, and since the typical procedure for site restore takes 7-10 days, you don’t have any time to waste. Open a support ticket for site restores from your Admin Center ASAP! You really, REALLY need to be fast, because the procedure can sometimes take some time. See this post for more info on this: A cautionary tale of relying on the automatic backups in SharePoint Online

I just wanted to get rid of the whole Site Collection!

If you want to start from scratch with your site, but don’t want a new URL, don’t try removing the root site. Recreate the whole site collection instead – see below for instructions!

The right way to remove the site collection is by either doing it programmatically, by using PowerShell or by going to Central Administration (if on-premises) or SharePoint Administration (if using SharePoint Online) and using the GUI to actually remove your Site Collection. See the screenshot below.

Delete site collection
Delete a site collection from SharePoint Administration on SharePoint Online

After deleting the site collection, and removing it from the recycle bin (see this for more info on how to do that!), you can then recreate the site collection with the URL that was reserved for it before.

Additional Resources

If you didn’t remove the root site, but rather a subsite (or a “subweb”), they’ll be in the site collection recycle bin.

See this article for more information: https://sharepoint.stackexchange.com/questions/173481/sharepoint-2013-deleted-subsites-not-going-in-recycle-bin

mm
4 1 vote
Article Rating
Subscribe
Notify of
guest

6 Comments
most voted
newest oldest
Inline Feedbacks
View all comments