Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

How to Delete a Content Type in SharePoint Online with PowerShell (PnP)

To delete a content type with PowerShell, connect with PnP PowerShell and run Remove-PnPContentType -Identity "Name" -Force. That works only when no list and no child content type still uses it, which is where most deletes fail.

In this tutorial, we’ll cover delete content type powershell jobs end to end: delete a site content type, remove it from a list first, fix the “still in use” errors, and handle child and published content types.

Here’s the shortest version that works:

Connect-PnPOnline -Url "https://spguides.sharepoint.com/sites/SPGuides" -ClientId "<your-app-client-id>" -DeviceLogin -PersistLogin

Remove-PnPContentType -Identity "SPGDemo Contract" -Force

When it succeeds, the content type is gone from the site with no output. Content types don’t go to the recycle bin, so there’s no undo.

Remove-PnPContentType vs Remove-PnPContentTypeFromList

PnP PowerShell has two cmdlets, and they do different jobs. If PnP isn’t set up yet, follow my guide to install PnP PowerShell for SharePoint Online first:

CmdletWhat it removesKey parameters
Remove-PnPContentTypeThe site content type itself, from the site you’re connected to-Identity (name or ID), -Force
Remove-PnPContentTypeFromListOnly the list’s copy; the site content type stays-List, -ContentType (no -Force)

-Force just skips the confirmation prompt. It doesn’t force a delete that SharePoint blocks.

How do I find the content type name and ID?

My demo site /sites/SPGuides has SPGDemo Contract, SPGDemo Invoice and its child SPGDemo Invoice Draft. SPGDemo Contract is also on the list SPGDemo CT Test:

# Find the content types you want to delete (name, ID, group)
Get-PnPContentType | Where-Object { $_.Group -eq "SPGDemo Content Types" } |
    Select-Object Name, Id, Group

# Which of them is attached to the list?
Get-PnPContentType -List "SPGDemo CT Test" | Format-Table Name
Get-PnPContentType listing the SPGDemo content types with their IDs and the list's content types

A child’s ID is its parent’s ID plus 01. SPGDemo Contract also shows up in the list, so it’s in use. To check every list, get all lists and libraries with PnP PowerShell and loop through them.

Fix “Another site or list is still using this content type”

Here’s what happened when I tried to delete SPGDemo Contract while the list still had it:

try {
    Remove-PnPContentType -Identity "SPGDemo Contract" -Force -ErrorAction Stop
    "Deleted SPGDemo Contract"
} catch {
    "Delete failed: $($_.Exception.Message)"
}
Remove-PnPContentType failing because a list still uses the SPGDemo Contract content type
Delete failed: Another site or list is still using this content type. If you would still like to delete it, please remove the content type from all sites and lists and then try again.

SharePoint won’t delete a site content type that a list or another content type is based on. The fix is to remove it from every list first.

Remove a content type from a list with PowerShell

The list removal failed too, because one item, Riverside Facilities – 2026 service contract, still used the content type. This script tries once, moves those items to the Item content type, then retries:

$list = "SPGDemo CT Test"
try {
    Remove-PnPContentTypeFromList -List $list -ContentType "SPGDemo Contract" -ErrorAction Stop
} catch {
    "First try: $($_.Exception.Message)"
}

# Move the items that use it to another content type, then remove it from the list
$ctId  = (Get-PnPContentType -Identity "SPGDemo Contract").Id.StringValue
$items = Get-PnPListItem -List $list | Where-Object { $_.FieldValues.ContentTypeId.StringValue -like "$ctId*" }
foreach ($i in $items) { $null = Set-PnPListItem -List $list -Identity $i.Id -ContentType "Item" }
"Items moved to Item: $(@($items).Count)"

Remove-PnPContentTypeFromList -List $list -ContentType "SPGDemo Contract"
Get-PnPContentType -List $list | Select-Object Name
Remove-PnPContentTypeFromList failing with Content Type is still in use, then succeeding after moving the item

The first try said Content Type is still in use. After one item moved to Item, the list kept only Item and Folder. To drop old items instead, delete all items from a SharePoint list using PnP PowerShell.

Note: deleted items count until they leave both recycle bins.

Delete the site content type

With no list using it, the delete works. The check proves it:

Remove-PnPContentType -Identity "SPGDemo Contract" -Force

$check = Get-PnPContentType -Identity "SPGDemo Contract" -ErrorAction SilentlyContinue
"SPGDemo Contract still exists: $([bool]$check)"
$left = Get-PnPContentType | Where-Object { $_.Group -eq "SPGDemo Content Types" }
"SPGDemo content types left: $(@($left).Count)"
Remove-PnPContentType -Force deleting SPGDemo Contract with a check that nothing is left
SPGDemo Contract still exists: False
SPGDemo content types left: 0

Delete a content type that has child content types

SPGDemo Invoice has a child, so deleting it returns the same “still using” message even though no list uses it. Delete the child first, here by its ID, then the parent:

try {
    Remove-PnPContentType -Identity "SPGDemo Invoice" -Force -ErrorAction Stop
} catch {
    "Parent delete failed: $($_.Exception.Message)"
}

# Delete the child first (by ID this time), then the parent
Remove-PnPContentType -Identity "0x010002FBAD6C994D2141A5B0B8824AA2289101" -Force
Remove-PnPContentType -Identity "SPGDemo Invoice" -Force
$check = Get-PnPContentType -Identity "SPGDemo Invoice" -ErrorAction SilentlyContinue
"SPGDemo Invoice still exists: $([bool]$check)"
Deleting the child content type by ID before the parent SPGDemo Invoice with Remove-PnPContentType

The parent failed, the child went by ID, and the last line printed SPGDemo Invoice still exists: False.

Can PowerShell delete a published content type from the hub?

Content types made in the Content type gallery live in the content type hub in SharePoint Online at /sites/ContentTypeHub. On a site with a published copy, unpublish it in the gallery first. That turns the copies into local content types you can delete as above.

To delete the original in the hub, connect to /sites/ContentTypeHub and use the same Remove-PnPContentType command. For more admin scripts, browse my PnP PowerShell scripts for SharePoint developers.

Cleaning up more than content types? These will help next:

Frequently Asked Questions

Does Remove-PnPContentType delete the content type from lists too?

No. It removes the site content type only, and it fails while any list still uses it. Run Remove-PnPContentTypeFromList on each list first.

What does -Force do on Remove-PnPContentType?

It skips the confirmation prompt, nothing more. The Remove-PnPContentType reference lists only -Identity, -Force and -Connection, and SharePoint’s in-use check still applies.

Why do I get “Content Type is still in use” on a list?

Items in the list still use that content type, including items in the recycle bins. Move them to another content type or delete them, then remove it again.

How do I delete a content type published from the content type hub?

Unpublish it in the Content type gallery first. Microsoft’s publish a content type guide says copies on other sites then become local content types you can delete.