0

I have a SharePoint Online environment with content types being published by the content type hub. During tests, I created some content types that I mistakenly deleted before unpublishing them. Now the hub keeps publishing old content types even thought they no longer exists in the hub. I'm aware that those deleted entries are now orphans stored in the managed metadata service.

Any ideas on how to permanently delete those old content types that weren't published prior the deletion?

0

PnP PowerShell to Delete Content Type in SharePoint Online:

#Config Variables
$SiteURL = "https://crescenttech.sharepoint.com"
$ContentTypeName ="Project Proposal V1"

#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)

#Get the content type
$ContentType = Get-PnPContentType -Identity $ContentTypeName

If($ContentType)
{ 
    Remove-PnPContentType -Identity $ContentTypeName -Force 
}

More information:

https://www.sharepointdiary.com/2016/04/sharepoint-online-delete-content-type-using-powershell.html

https://www.sharepointdiary.com/2016/12/fix-another-site-or-list-is-still-using-this-content-type-error.html

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.