Forum Discussion
Content Type Deletion not possible
Hello,
I am an IT service provider and manage parts of the SharePoint intranet at the administrative level for the customer. We use content types extensively for a uniform administration of metadata.
A few months ago, a content revision was carried out. Due to this revision, some published content types had to be deleted.
First, the new content types were published via the SharePoint admin center. Then they were integrated into the website libraries and then a PowerShell script was used to switch the content type from the old to the new variant on all site pages.
After that, the publication of the content types to be deleted was undone via the admin center and then deleted in all affected website libraries.
This was successful for the majority of the affected libraries. For some libraries, an error message was displayed indicating that the content type was still in use:
We have analyzed the problem so far with the following methods:
Checking the existing site pages for content types of the old variant that are still integrated. No elements could be found.
PowerShell script to determine elements in affected website libraries that still use the old content types. No elements were found.
I am hoping for a productive exchange here to definitively resolve the issue. I am happy to provide further details on the subject, but will only publish them within the scope of customer protection.
1 Reply
- PiperAndersonIron Contributor
1. Step-by-step deletion method
Method A: Forced deletion through the UI
Go to Site Settings → Site Content Type
Find the target content type → click “Settings” → “Delete this content type”.
If error is reported, try:
Remove all columns first
Remove inheritance from parent content type
Method B: Forced deletion by PowerShell
powershell
# Connect to SharePoint
Connect-PnPOnline -Url “https://yourdomain.sharepoint.com/sites/yoursite” -Interactive
# Get content type
$ct = Get-PnPContentType -Identity “YourContentTypeName”
# Force removal
Remove-PnPContentType -Identity $ct.Id -Force
2. Handling special dependencies
Common impediments:
Workflow associations: check and uncheck associations in SharePoint Designer
Information Policy: Check retention policy in Compliance Center
Content Type Center Synchronization: need to unpublish on the central site first
3. The Ultimate Solution
Use SharePoint API:
Get Content Type ID via browser developer tools (F12)
Send API request:
http
POST /_api/web/contenttypes('0x0100...') /deleteObject() HTTP/1.1
X-RequestDigest: “your-digest-value”
4 Precaution.
Best Practice:
Use a script to check dependencies before deletion:
powershell
Get-PnPContentType -Identity “YourCT” | Select-Object -ExpandProperty FieldLinks
Establish a Content Type Lifecycle Management System
Periodically clean up unused content types