SharePoint 404 Error Site Collection Corrupted (Error 0x80070003) How to Delete

Previously we took a look at a possible cause of a 404 error in SharePoint after a content database restoration. This time we have determined that the site collection is corrupt, and we don’t have any backups (you should always have backups). Another scenario is that we just want to get rid of the site collection, but for whatever reason, you cannot remove the site collection.

Attempting to Remove a Site Collection using Remove-SPSite and Remove-SPDeletedSite

First, we get the site name and id into a variable

$site = Get-SPSite
$siteguid = $
echo $siteguid

Site Guide

Now we can try and remove the sites with both standard PowerShell commands:

Remove-SPSite -Identity $siteguid -GradualDelete -Confirm:$FalseRemove-SPDeletedSite -Identity $siteguidtext

Remove SharePoint Site Error

Neither one worked, so let’s try again with a different command. (  We will set the gradual delete and restorable both to false.

$siteDatabase = $site.ContentDatabase
$siteDatabase.ForceDeleteSite($siteId, $false, $false)

NOTE: The old DELETE FROM .[SiteMap] WHERE Id=’’ will not work on 2013.

Force Delete Site PowerShell

Now the site is gone and you can replace it with a fresh one.