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?

1 Answer 1


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

    Remove-PnPContentType -Identity $ContentTypeName -Force 

More information:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.