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 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!"
}