I got few corrupted lists when a custom code, which provisions lists got stuck in middle! I couldn't delete the corrupted list neither from SharePoint web interface nor using SharePoint Designer!
When I tried to access the corrupted SharePoint list from browser, received this error message:
"List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user."
Alright, How to force delete corrupted SharePoint list? To delete corrupted list in SharePoint, we can either use STSADM command line tool or PowerShell.
Delete corrupted list in SharePoint 2007 using STSADM:
We can delete the corrupted list using stsadm forcedeletelist command. Here is how:
Stsadm -o forcedeletelist -url <LIST URL>
SharePoint delete list with PowerShell
We can delete the corrupted list using PowerShell programmatically. Here is the script for SharePoint 2010 to delete corrupted list:
or use this alternate approach: Force delete list SharePoint 2010 PowerShell
BTW, there are other causes for the error: "List does not exist.", I got this error message after a SharePoint migration.
When I tried to access the corrupted SharePoint list from browser, received this error message:
"List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user."
Alright, How to force delete corrupted SharePoint list? To delete corrupted list in SharePoint, we can either use STSADM command line tool or PowerShell.
Delete corrupted list in SharePoint 2007 using STSADM:
We can delete the corrupted list using stsadm forcedeletelist command. Here is how:
Stsadm -o forcedeletelist -url <LIST URL>
SharePoint delete list with PowerShell
We can delete the corrupted list using PowerShell programmatically. Here is the script for SharePoint 2010 to delete corrupted list:
#Get the Web $web = Get-SPWeb "<SharePoint-site-URL>" #Get the corrupted List $list = $web.lists["corrupted list name"] #Set the AllowDeletion Flag to True $list.AllowDeletion = $true $list.Update() #Delete the list $list.Delete()
or use this alternate approach: Force delete list SharePoint 2010 PowerShell
Get-SPWeb "http://sharepoint-site-url" | where-object { $_.Lists["corrupted list name"].Delete() }This removes corrupted list in SharePoint 2010.
BTW, there are other causes for the error: "List does not exist.", I got this error message after a SharePoint migration.
- DNS/AAM entries are not properly configured.
- User doesn't has access to content type/Document Template which is being used by the list.
- Site may be locked! Go to: Central Administration, Site collection quotas and locks to unlock the site.