Deleting Content Types
I can't delete a content type from a document library in MOSS.Using the GUI to delete a content type from a document library gives: Content Type is still in use I have verified that all documents are assigned to a different content type and I've poked around in the content database, but it doesn't look simple. Please help!Thanks,Mindy
June 19th, 2007 6:32pm

Hey Mindy, The following T-SQL is not supported by anyone of note (as I just created it). You should not use this to reverse engineer the content type process as I may be forgetting some very important link. Please do feel free to use this T-SQL to find dependenciesof this content type. Since content types canbe inherited, you may find that even though no list is using a content type, you still won't be able todelete it until you delete its child content types. Be sure to replace 'Document' with the name of the content type you wish to look for. Code Snippet DECLARE @ContentTypeName nvarchar(128) SET @ContentTypeName='Document' SELECT w.Title AS [Web Site], w.FullUrl AS [Web Url], al.tp_Title AS [List Title], ct2.* FROM ContentTypes ct1 JOIN ContentTypes ct2 ON LEFT(ct2.ContentTypeId, Len(ct1.ContentTypeId))=ct1.ContentTypeId LEFT OUTER JOIN dbo.ContentTypeUsage ctu ON LEFT(ctu.ContentTypeId, Len(ct2.ContentTypeId)) = ct2.ContentTypeId LEFT OUTER JOIN dbo.AllLists al ON ctu.ListId = al.tp_Id AND ctu.WebId=al.tp_WebId LEFT OUTER JOIN dbo.Webs w ON al.tp_WebId = w.Id WHERE ct1.ResourceDir=@ContentTypeName
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2007 8:10am

Hi Curtis, This is fantastic for finding where a content type is used across the board - thank you! I ran this on the content type I need to get rid of, but it found nothing (I ran it on another content type and it worked just fine). I just need to delete the darn thing from a particular document library. Thanks! Mindy
June 21st, 2007 1:03am

Mindy, Make sure that content type isn't associated w/ any lists. Just b/c you don't have any documents of that content type doesn't mean the content type isn't in use. I has a similar issue and was able to resolve it by deleting the list the content type was associated w/. I assume you could simply change the settings on the list just as well. P
Free Windows Admin Tool Kit Click here and download it now
June 21st, 2007 6:26pm

Hi Purse, The problem is that I need to delete the content type just from one document library (list). The GUI will not allow me to do it and says that the content type is in use (within the doc library). It is not in use in anyvisible manner. Thanks,Mindy
June 21st, 2007 7:08pm

Hey Mindy, Upon reading your original post, I realized I overshot your original question. Although I don't have a fantastic solution for you at this time, let me at least make you did the minimal steps for deleting a content type within a list. After modifying all documents within the document library to not use the content type, did you verify that the existing content type you want to delete is not the default content type? Also, once that has been changed, have you tried to disable content type management? Just some food for thought.
Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2007 5:45am

Hi Curtis, Yes, I did all of that. I did not disable content type management however, because I need the other content types. Are you suggesting to disable and then re-enable? Thanks, Mindy
June 25th, 2007 10:26pm

Yes, disable, delete, then re-enable. There is a slight chance you will be able to delete it. Also, check the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS directory and look for the latest computername / timestamp log entry. See if you can find any more information regarding the deletion of the content type in that log.
Free Windows Admin Tool Kit Click here and download it now
June 26th, 2007 3:34am

Well, you can't delete a content type when management is disabled. But I disabled, re-enabled, and still could not delete. There is nothing in the logs with regard to the attempt to delete the content type. Do you happen to know which diagnosic logging category reports on content type activities? Thanks, MIndy
June 26th, 2007 10:08pm

The log would have the content type or some part of the error message you see in it. How about creating a network place to the document library in question, perform a copy & paste operation into a regular Windows OS folder (possibly your desktop), delete the documents from the document library, and then try to delete the content type. If nothing else, you should be able to delete the document library and re-create it. Then add your documents back in once you have the updated / recreated document library in place. Assign the content types to each document as appropriate. Caution, this will delete all SharePoint-specific metadata (to including versioning) from the documents.
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2007 8:11am

I thought about doing that, but I'm trying to avoid it as it would be a lot of work and we would have to sacrifice important metadata and versions. Maybe when Syntergy's Copy and Paste is released... Mindy
June 27th, 2007 9:01pm

I haven't forgotten about your problem, but I don't have any good ideas either. Maybe check your Recycle Bin for documents that may be attached to the ContentType you wish to delete. Whenever documents are deleted into the Recycle Bin, they should no longer be referenced anywhere, so this is a long shot. Be sure to delete the documents from the Administrative Recycle Bin as well. If this doesn't work, I really don't have any more advice to offer you. Sorry.
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2007 7:04am

I had the exact same problem. Turns out that there were still references to the content type from the documents in the recycle bin. I emptied out the recycle bin, as well as the administrators recycle bin, did an IISRESET, and then I could successfully delete the content type. Not sure if you have trailing references to the content type anywhere else Mindy.
August 7th, 2007 12:10pm

Hi .. I defined a contenttype in a feature.. but you can set the guid of the contenttype and this is id sets the parent e.g. a contenttypes parent is system page, and can that be the reason that i cant delete my contenttype?
Free Windows Admin Tool Kit Click here and download it now
August 16th, 2007 11:52am

Hi thereI had the some problem ... I needed to delete some Content Types (from the GUI) created within SP Designer .After some hours I was able to delete all.- In my case, I started to delete all my WorkFlow data and then my DocLib- Then from the "Site Actions" I was able to delete some of my Content Types and Custom Columns.- But I was unable to delete some of them..- Checked and deleted my WorkFlow tasks (TASKS List) and WorkFlow History - With the help of SP Designer - Then cleaned up my site Recycle Bin and Site Collection Recycle Bin- IISReset /noforce on the server- Went back to my "Site Action", started with "Site Content Type" and there you go... deleted all of my unwanted CT and inthe "Site Columns" option I was able to remove my unwanted columns. I hope this would help some of you. Ricardo R FrancoLisboa - Portugal
January 15th, 2010 7:15pm

This post is for 2007 but I had the same problem in 2010. Please see my post at http://social.technet.microsoft.com/Forums/en-US/sharepoint2010general/thread/a36ff299-8934-49e6-b55f-f78bc1a449c6 to how to avoid this problem.
Free Windows Admin Tool Kit Click here and download it now
June 15th, 2011 11:13am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics