So, you have a list item or document in a library that no matter what you do, it just won’t let you delete it or undo a check out. You are sure you have the proper permissions, but alas, the document or item is even more stubborn than me and just won’t go away!
Perhaps one of the issues below has occurred:
- Someone renamed a document that was already uploaded and it became corrupt.
- Something was checked out by another user who is no longer there and it went bonkers so you can’t check it back in to delete it.
- There was custom code written that has somehow altered the document and it has now become unruly.
Here are the steps I perform when I cannot delete documents & list items in SharePoint that are being a wee bit insubordinate:
1. Selecting Delete or Undo Checkout.
You have probably tried this already or you wouldn’t be reading this article, but here we go. While you are logged in as the Farm Admin or Site Collection Admin, attempt to delete the document or list item by clicking the arrow to the right of the document and selecting delete or checking the box to the left of the document and using the ribbon to select delete.
2. Content and Structure
This feature will only be available if Publishing is enabled on your site. By selecting Site Actions –> Manage Content and Structure, follow the same steps above by clicking the delete option in the drop down or via the ribbon under Actions–> delete with the box checked next to the document (if you do not see this option in the drop down you do not have a high enough permission level).
3. Open in Windows Explorer.
In this example, the context is in Russian, but the button is always in the same place in the ribbon bar (at least in SP2010). This option basically opens the lists/libraries in more of a folder like view. I don’t believe this option is there for a list however, only libraries.
As an Administrator, go onto the server and open PowerShell.
If you just want to try and discard a page checkout from someone else via PowerShell, check out this script Discarding Check Out Using PowerShell. I had to use $myFile = $myList.Files | out-gridview to get a list of the page titles and alter the script a bit because I think it wants the “Title”, not the file name, but you can play around with it if you like to see if it will work for you.
5. Use SharePoint Designer.
It is important to perform the steps below as initially when I tried this, I had SPD installed locally on my machine and it deleting the document did not work. Install SharePoint Designer on the server (if you want to take a backup of the server first I understand). Run SPD as an Administrator (right click – Run as Administrator) and make sure you are using either the Farm Admin ID, the System Account or one of the Service Account IDs (you may need to try all of these IDs as I had mixed results myself). You can now uninstall SPD from the server if you would like to.
6. SQL Server Database / SQL Query
Finally, I am mostly certain this is not supported by MSFT, however it has worked for me in the past as an absolute last resort (take a backup of that database before you touch it just in case!). It’s time to go directly into the SQL tables to find the specific item by GUID.
Now that we have the GUID to delete the document, it must be removed from both of these tables:
If you are removing a list item instead of a document, there may be different SQL tables you need to query and delete from than the 2 listed above.
Other Completely Untested, Unsupported, Warranty Invalidating & Farm Disabling Ideas
If the document is checked out to someone who no longer is there, delete the person’s ID who has it checked out. I am not sure what would happen with this, but feel free to let me know if you are brave enough to do it (evil grin).
Best SharePoint Hosting Recommendation
ASPHostPortal.com provides its customers with Plesk Panel, one of the most popular and stable control panels for Windows hosting, as free. You could also see the latest .NET framework, a crazy amount of functionality as well as Large disk space, bandwidth, MSSQL databases and more. All those give people the convenience to build up a powerful site in Windows server. ASPHostPortal.com offers SharePoint hosting starts from $5. We also guarantees 30 days money back and guarantee 99.9% uptime. If you need a reliable affordable SharePoint Hosting, we should be your best choice.