1

I'm trying to delete a content type but it tells me to remove all references of it before doing so.

But I don't remember all the places where I have referenced it.

Is there a easy way to find them? Or must I look for it in every corner of the website?

  • Just note that you also have to delete any items using that content type from the Recycle Bin as well. – Erin L Mar 17 '16 at 13:48
  • I did that already – Phiter Mar 17 '16 at 13:58
  • Cool. That's just one of those things some of us learned the hard way. :) – Erin L Mar 17 '16 at 14:12
4

There are couple of ways to find it.

  1. Use the SharePoint Manager from Code plex

    • Download the SharePoint Manager 2010 from Codeplex
    • Open SPM and Navigate to the target Site Collection where your Content Type is located
    • Go to Content Type >> Usages to find all content type usages
    • Delete all the usages of the Content Typeenter image description here
    • Once done, You can delete your content type without any issues
  2. Use the Powershell,

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

    //Get the site
    $site = Get-SPSite "<a class="vglnk" 
    // Name of the Content Type
    $ContentTypeName = "Travel Request"
    
    // Loop through all web
    
     Foreach ($web in $site.AllWebs)
        {
    
      //Get the Content Type
    
      $ContentType = $web.ContentTypes[$ContentTypeName]
    
      //Check if content type exists
    
         if($ContentType -ne $null)
      {
    

//Get the Content Type Usage

       $CTypeUsages = [Microsoft.SharePoint.SPContentTypeUsage]::GetUsages($ContentType)

       if ($CTypeUsages.Count -gt 0)
       {
           foreach ($CTypeUsage in $CTypeUsages)
        {
                write-host $CTypeUsage.Url
           }
       }
      }
      $web.Dispose();
     }

Read more: http://www.sharepointdiary.com/2013/04/the-content-type-is-in-use-error.html#ixzz42znYwDzs

  • Actually this image gave me an idea. The content type was linked in the Workflow Tasks list. Removing it allowed me to delete the content type. Thanks – Phiter Mar 17 '16 at 14:00
  • 2
    The mentioned solution works only for sharepoint on premises, not online. Sharepoint client CSOM doesn't have ContentTypeUsage property. – Alen Pesikan Aug 12 '16 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.