Error When Deleting Content Type - The content type is part XXX of an application feature

Tags: SharePoint 2010, Contenet Type Delete

Try Powershell

CLS
$site = Get-SPSite -Identity "<<site url>>"
$rootweb = $site.OpenWeb()
$featureID = Get-SPFeature -Identity "<<feature guid>>" -Site "<<site url>>" -ErrorAction SilentlyContinue
if ($featureID -ne $null) {
	Disable-SPFeature $featureID.Id -Url "<<site url>>" -ErrorAction SilentlyContinue
	for($ct=0 ;$ct -lt $rootweb.ContentTypes.Count ; $ct++)
 	{
		if ($rootweb.ContentTypes[$ct].Name.Equals("<<Content type name>>"))
		{
			$rootweb.ContentTypes[$ct].Delete();
		}
	}
}

If not delete form DB at own risk

SELECT *  FROM [WSS_Content].[dbo].[ContentTypeUsage]
WHERE (sys.fn_varbintohexstr(ContentTypeId) LIKE '0x01004367EA9F0DE94985865DB869D6DCAFC5%')
--DELETE FROM [WSS_Content].[dbo].[ContentTypeUsage] --	WHERE (sys.fn_varbintohexstr(ContentTypeId) LIKE '0x01004367EA9F0DE94985865DB869D6DCAFC5%')


SELECT * FROM [WSS_Content].[dbo].[ContentTypes]
	WHERE (sys.fn_varbintohexstr(ContentTypeId) LIKE '0x01004367EA9F0DE94985865DB869D6DCAFC5%')
--DELETE FROM [WSS_Content].[dbo].[ContentTypes]  
--	WHERE (sys.fn_varbintohexstr(ContentTypeId) LIKE '0x01004367EA9F0DE94985865DB869D6DCAFC5%')