Home > SharePoint 2010, SharePoint Advancements > Remove Orphaned Content Types in SharePoint 2010 That Are Associated With a Feature.

Remove Orphaned Content Types in SharePoint 2010 That Are Associated With a Feature.

This blog relates to an earlier blog I have http://jshidell.com/2012/06/07/removing-a-corrupted-site-column-in-sharepoint-2010/ where there were orphaned content types found in content databases that needed to be removed because it prevented me from activating Site Collection features.

For this blog I will discuss how you can remove Orphaned Content Types found in your Site Collection Site Content Type lists that you can not delete through the SharePoint GUI because they are associated with a feature that is no longer deployed or unavailable in your SharePoint 2010 farm, and you no longer need these Content Types.

In my case I had 8 different Orphaned Content Types that were left behind after a solution was retracted from my SharePoint 2010 farm.  Depending on how these solutions were developed in most cases once a solution is retracted it should also take along with it their content types.  However this was not the case for me.

The solution I was dealing with here was Visual Fusion, this 3rd party solution was no longer needed in our environment and I needed to get rid of all its references.

Since Visual Fusion does not automatically remove their content types after retracting, these content types still lived in our content databases.

When I tried to delete these content types from the Site Content Type lists I got an error stating that this content type is part of a feature, and would not allow me to delete it.

What happens here is there is a column(field) in each ContentTypes table in each Content Database called isFromFeature  This column specifies if each content type is associated to a feature or not.  If the flag=1 its associated to a feature if the flag=0 then it is not.

The only way around fixing this problem is to do a direct DB modification.

As I stressed in my blog link above doing any type of DB modificiation/fix is not supported by Microsoft unless you get direct approval from them that its ok.  For all my cases like this I open up a case with them to protect me just incase I need premier Microsost support later.

So if you ever run into this issue, make sure you get Microsoft’s approval before proceeding, unless you don’t care about receiving premier support.

Below are the steps to fix this issue:  Proceed with caution.  I’m not responsible for your farm.

===========================================================================================================

1.  Determine which Content Database(s) have these orphan content types.  If you have multiple content databases, you can determine which site collection lives in which Content Database by going to (Central Administration, Application Management, View all site collections)

2.  After you determine which Content Database(s) need these orphaned content types removed, head over to your Database Server (I’m assuming SQL).

3.  Once on your database server bring up SSMS and open up a new query window.

4.  Type inside the query window, and execute query

SELECT * FROM [NAME OF CONTENT DATABASE].[dbo].[ContentTypes] WHERE Definition like ‘%NAME OF Content Type%’

5.  If you look at the results you should see the IsFromFeature flag set to 1 for these content types

6.  We will now want to update this flag from 1 to 0

7.  Inside that same query window, type

UPDATE [NAME OF CONTENT DATABASE].[dbo].[ContentTypes] SET IsFromFeature = 0 WHERE Definition like ‘%NAME OF Content Type%’

8.  This will update the flag in IsfromFeature from 1 to 0

9.  Run the Query command from step 4 again to verify that the flag did change.

10.  If successful, go back to your Site Collection Site Content Types, and now you should be able to open up each Content Type and delete.

============================================================================================================

Hopefully this is hopeful for others who have encountered this same problem

Advertisements
  1. srinivas
    May 7, 2014 at 12:52 pm

    Its very Nice Article it help me lot

  2. Osvaldo Junior
    August 1, 2014 at 6:40 pm

    Thank you! It was very helpful xD

  3. June 21, 2015 at 9:57 pm

    Very good post. I definitely appreciate this site.
    Stick with it!

  1. March 22, 2013 at 12:06 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: