SharePoint Online - Cannot Delete Content Type


I created a content type in SharePoint online, and am now trying to delete that content type. I get the error that the content type I am trying to delete is still in use, and that I need to remove it from all lists or sites first.

So far I have tried:
  1. Deleting all documents that used this content type.
  1. Emptied the recycle bin after deleting the documents.
  1. Deleted the entire document library that used this content type.
  1. Downloaded SharePoint Online Client Browser from Github, but this doesn't show content type usage.
  1. Tried various powershell scripts, but the examples are not for SP online.
  1. Tried to use CSOM, but I cannot seem to find content type usage

Any ideas, code or scripts that can show content types usage for SPO would be much appreciated.
Who is Participating?
Zaheer IqbalTechnical Assurance & ImplementationCommented:
Nice Technet Script. Script to find lists and libraries
Zaheer IqbalTechnical Assurance & ImplementationCommented:
Have you deleted it from the task list ?
maaknplanAuthor Commented:
Thanks for the reply. There are no task lists in any of the sites unless I am missing something. I ran a CSOM version of the Technet script you suggested, and still came up with nothing. I added the content type to a few libraries to test the code.
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

maaknplanAuthor Commented:
This code pointed me in the right direction to find content types.
Walter CurtisSharePoint AEDCommented:
You need to remove the content type from the document library, not just the document in the library.

Good luck...
maaknplanAuthor Commented:
It turns out the library I deleted was still lurking in the secondary recycle bin in the admin site. Once I emptied the secondary recycle bin, the content type deleted with no problem.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.