Disable Delete List Option in SharePoint

What? We’ve a SharePoint list provisioned to store & retrieve custom application settings in a SharePoint site. Its critical to prevent this list from any accidental deletion, so we want to disable delete list option from list settings in SharePoint.

How? We can disable “Delete this list” link in SharePoint by setting the List or Library’s AllowDeletion Property to “False”. Once set, delete option will go hidden.

SharePoint list hide delete option

Disable “Delete This List” in SharePoint list

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the web where the particular list lives
$web = Get-SPWeb "https://sharepoint.crescent.com/sites/operations"
#Get the list
$list = $web.Lists["AppConfig"]
#Make the list 
$list.AllowDeletion = $false
$list.Update()

Result: SharePoint delete list missing!
sharepoint 2010 delete list missing
In this way, we stop users from deleting SharePoint lists. If you notice, in some SharePoint lists & libraries (E.g. “Farm Templates” library), “Delete this List” or “Delete this Document Library” links are missing by default to prevent the delete option.

Revert the flag “AllowDeletion” to “True” programmatically if you must delete a list that doesn’t offer the “Delete this list” link. Once this flag set to false, we can’t delete it even programmatically! You will get a “This list cannot be deleted.” error if you try to delete it.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *