I created a content type to play around with. I created a publishing page based on this content type, but after deleting the page (and clearing the recycling bin) SharePoint won't let me delete it.
The content type is in use.
After some investigation, I ran the following PowerShell code which would tell me where the content type is being used.
$site = Get-SPSite("http://mySite");
foreach ($web in $site.AllWebs) {
$ctype = $web.ContentTypes["Test-publishing-page-parent"]
$usages = [Microsoft.Sharepoint.SPContentTypeUsage]::GetUsages($ctype)
foreach ($usage in $usages) {
Write-Host $usage.Url
}
}
The output was /Pages
There are no more pages that exist in the Pages collection (or the recylcing bin) that reference the content type.
However, I did notice that the "New Document" selection drop down contains references to this content type (and others!). In fact, it seems that I cannot delete any custom content types that are referenced in this selection drop down, even though they are not used anywhere else. Any ideas? Is this a possible bug in SharePoint 2013?
Note: Yes, I've already cleared the recycling bin several times, at the site level and the site collection level.
SharePoint 2013 on-premise.