Somehow a developer has managed to royally screw up a site collection. The site collection has the Publishing Feature enabled and it's working fine. A botched migration from 2007 to 2010 has caused some issues. Now the "Site Collection Documents" and "Site Collection Images" show up twice when you go to the View All Site Content page. In addition, clicking on the lists yields an error as it can't seem to find the list.

The fun part is opening up SharePoint Designer. You can bring up the lists and they actually have a GUID. Trying to delete the lists in SPD yields an error message "Could not save changes. This list cannot be deleted" (regardless of what account I use). And I even tried using a PowerShell command to delete the list. I get the same error, "Cannot delete list".

I suspect the list doesn't exist but there's still a record of it in the database. The only way I can think of fixing this is to do a direct database edit, which I really want to avoid.

Looking for new suggestions or ideas.

  • 8
    Always us developers, isn't it Bil? ;) I blame your IT Pros and their botched migration myself :P
    – James Love
    Dec 8, 2011 at 13:54
  • When you open the site up in SharePoint Manager, what do you get then? Able to delete through that? What does ULS say when you attempt to delete the list with any method?
    – James Love
    Dec 8, 2011 at 13:55

5 Answers 5


I hate answering my owner questions here but found the problem. There's a flag on lists you can set a list to AllowDelete or not (this is for lists that are critical to the operation of a feature). The flag on these lists were set to False and wouldn't allow deletion. It still doesn't explain why the list was showing up twice both in the UI and SharePoint Manager (but only once in SharePoint Designer).

The fix is to use SharePoint Manager to set the flag on a list as AllowDelete = True then you can delete it (through SharePoint Manager or SharePoint Designer). Note that you cannot get to this property through SharePoint Designer so you either have to use SharePoint Manager or write some code (C#, PowerShell, or JavaScript) to set this flag.

It would have been more helpful if the error message was something along the lines of "This list is configured to not allow deletion." instead of just "Cannot delete list".

Edit: You can also use the PowerShell described in another answer. I haven't tested it but it should work.

  • Thanks for the great description of how you solved the problem, I'll be sharing this with a couple of people here that have encountered that problem.
    – GavinB
    Dec 8, 2011 at 20:06

Here is an example in C#

var web = SPContext.Current.Web;
var links = web.Lists.TryGetList("Links");
if (links != null)
    links.AllowDeletion = true;

See why to use web.Lists.Delete()


you may get some clues by checking the exception it throws upon deletion - http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.delete.aspx

  • 1
    1. $fooweb = Get-SPWeb fooUrl 2. $foolist = $fooweb.Lists["fooList"] 3. $foolist.AllowDeletion = $true 4. $foolist.Update() 5. $foolist.Delete() 6. $fooweb.Dispose() Dec 8, 2011 at 16:28
  • dang! can't figure out this "mini-Markdown formatting".. the POSH script excerpt above should force a list deletion.. Dec 8, 2011 at 16:29
  • Surround the code you wnat highlighted in ` (backtick) characters.
    – James Love
    Dec 9, 2011 at 18:16

It might be worth adding (even after all these years) that some libraries are shipped with the SharePoint Server Publishing feature and they cannot be deleted through the user interface (due to the AllowDeleting property).

However, they CAN be deleted by disabling this feature, which can be an option in some cases (in my case I managed to get rid of a Documents library on a subsite).


I had the same problems too. I resolved it in 3 steps

  1. I moved all the other normal site collections to a different content database using commands like this:

    Move-SPSite http://url/of/site_collection -DestinationDatabase contentDb2 -Verbose iisreset

  2. I Deleted the content database and then recreated it using the commands below:

    Remove-SPContentDatabase contentDb1 New-SPContentDatabase contentDb1 -WebApplication http://web_application -DatabaseServer serverName -Verbose

  3. I moved the other normal site collections back into it:

    Move-SPSite http://url/of/site_collection -DestinationDatabase contentDb1 -Verbose iisreset

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.