Force Delete a Corrupted Site Collections using PowerShell

There is a strange issue in SharePoint 2013 environment today! One of the site collection provisioned via custom code is unreachable with “404 page not found” error. However, the particular site is listed under central administration >> View all site collections! But no further details such as Content database, etc. are available for the site collection in Central Administration.

We concluded that the site collection is “Corrupted!”. There are many scenarios where a site may go corrupted, such as: Storage media failure, Network connectivity issues, incorrect usage of PowerShell cmdlets (E.g. If you use Copy-SPSite without “DestinationDatabase” parameter, You’ll end-up in a corrupted site!), etc.

So, We tried deleting the site collection from SharePoint central admin, but SharePoint central administration didn’t let me to select and delete the site. Tried STSADM -o DeleteSite and Remove-SPSite PowerShell cmdlet with no luck!

Stsadm and PowerShell ways resulted with an Error:  <nativehr>0x80070003</nativehr><nativestack></nativestack>

sharepoint delete corrupt site collection
sharepoint cannot delete site collection

Solution: How to Delete Corrupted Site Collections in SharePoint?

We can delete corrupt site collections with either STSADM or with PowerShell in below methods.

STSADM to delete corrupt site collection:
Step 1: We need site ID, Database Server, Database name parameters of the site we need to delete. Run:  

 stsadm -o EnumAllWebs > SitesList.xml

This produces a XML file with details such as site collection ids, content database, database server, etc as below.

How to force delete a Site Collections using PowerShell

Step 2: Extract required parameter values and supply it to STSADM -o DeleteSite as:

stsadm -o deletesite -force -siteid “1252fd8f-a0ea-4ef9-9b66-4715f8e44b37” -databaseserver SP13-Ent-SQL01 -databasename SP13_Intranet_Content

How to delete a Site Collections using stsadm

The Same method applies to corrupted site (web) as well. E.g.:
stsadm -o deleteweb -force -webid <Web ID> -databasename <database name> -databaseserver <database server name>

Delete corrupt site collection with PowerShell:

Use this PowerShell script to delete a corrupted site collection in SharePoint.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$CorruptedSiteURL =""

#Get the site collection
$site = Get-SPSite $CorruptedSiteURL

#Get the GUID of the site collection
$siteGUID = $site.Id
Write-host "Site collection GUID:"$siteGUID

#Get the content Database of the Site collection
$siteDatabase = $site.ContentDatabase 

#Force delete the site collection
$siteDatabase.ForceDeleteSite($siteGUID, $false, $false)

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

2 thoughts on “Force Delete a Corrupted Site Collections using PowerShell

  • October 2, 2021 at 3:30 PM

    Hi Salauddeen,

    Wonderful article!
    I have one clarification, how we can delete the orphaned personal sites from SharePoint on-premise using Rest API?

  • December 14, 2016 at 2:05 AM

    Really Very Helpful. Thank you Salaudeen 🙂


Leave a Reply