I came across this blog that stated that you also needed to look into previous versions of the files as well as files hidden.
Despite the fact that I have done this I cannot delete the ContentType.
I therefore looked into the SQL database in the AllUserData table in the Content database with the following SQL
WHERE (tp_DirName LIKE '
AND ((tp_ContentType = '
ORDER BY tp_DirName
Then I got a list of files using the content type.
The main issue now is that I cannot figure out how to get rid of the content type from these files. Ideas very much appreciated.
- Checked in documents
- Published them all - i.e. major version
- Previous versions has been deleted
- Emptied recycle bin
- Ensured the content type I wish to delete is not default content type (apart from the fact that SharePoint suggest it to be the new default when uploading documents - which is strange. Maybe this is the reason?)
So what do I do?
Even if I DELETE the files and REMOVE them from recycle bin they still appear in the SQL search. No wonder I cannot get rid of the content type!
Even if I go through all files in the Document Library and explicitly set
oFile.Item("ContentType") = <...>
I cannot DELETE the content type afterwards. Very strange.