Sorry, something went wrong the content type is in use


When we tried to delete a content type, we are getting an error “Sorry, Something went wrong the content type is in use”.
So we prepared a PowerShell script to get the list of places we used the content type in the site collection level and its sites/sub sites

Add-PSSnapin Microsoft.sharepoint.powershell
$site = Get-SPSite("");#enter your site collection URL
foreach ($web in $site.AllWebs) {
    $contypes = $web.ContentTypes["your content type name"]#enter your content type name
    foreach ($ctype in $contypes) {
        $usages = [Microsoft.Sharepoint.SPContentTypeUsage]::GetUsages(
        foreach ($usage in $usages) {
        Write-Host $usage.Url

Finally in the Output, we can able to identify the list if place we used the content type, so if you don’t want to use this content type anywhere, delete it first in the usage url location, then finally delete at site collection level.

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment


Post a Comment