Delete List Template in SharePoint using PowerShell

Requirement:  Delete a list template in SharePoint

How to delete a list template SharePoint?

To remove a list template in SharePoint,

  • Login to your SharePoint site collection (List templates are scoped at site collection level) >> Click on Settings >> Site Settings
  • On the “Site Settings” page, click on “List Templates” under Web Designer Galleries (https://yoursite.com/_catalogs/lt)
  • Select the list template to delete and click on “Delete Document” from the ribbon
  • Confirm the prompt to delete a custom list template in SharePoint.
    delete list template in sharepoint

Delete list template in SharePoint 2013 using PowerShell

Here is how to delete SharePoint list templates using PowerShell script:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables for Site URL and List template name
$SiteURL="https://intranet.crescent.com/sites/sales/"
$ListTemplateName ="Project Health.stp"

#Get Site and List Template Folder objects
$site = Get-SPSite $SiteURL
$ListTemplateFolder = $site.RootWeb.GetFolder("_catalogs/lt")

#Find the Specific List template and delete
$ListTemplate = $ListTemplateFolder.Files | Where-Object { $_.Name -eq $ListTemplateName }

if($ListTemplate)
{
    $ListTemplate.Recycle()
    #To permanently delete, call: $ListTemplate.delete();
    write-output "Deleted List template!" 
}

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 *