Take care when adding or removing columns from Site Content Types

As mentioned before the content types on a list are actually children of the site content types. I’ve also looked at adding columns to list content types, which naturally enough doesn’t affect their parent site content types. Anyway, there are issues to consider when dealing with adding and removing list content types – I suggest you refer to this post for more information.

So what about adding and removing columns from Site Content Types – are there issues with this? Well, yes, there are (unsurprisingly). If you add a new column to a Site Content Type, you have the option to ‘Update all content types inheriting from this type’

Update Child Content Types

If you select ‘no’, then the change only applies to that Site Content Type. The next time you add that site content type to a list, the new List Content Type that is created will have the new column, but pre-existing list content types that inherit from the site content type will be unchanged.

If you select ‘yes’, then the List Content Types (or other Site Content Types) that inherit from this content type will have the new column. For the List content types, this means that there will be a new column on the list. Carrying on from an earlier example, here I’ve added a new column (‘Job Title’) to the Example Travel Expenses site content type, and updated all content types inheriting from that. If we then go an look at the List Settings page, we can see our List Content Type has a new column:

Extra List Columns 2

Great! Now what happens if I remove that column from our Site Content Type? Well, again, I get the option to ‘Update all content types inheriting from this type’. If I choose no, then the existing List Content Types derived from this Site Content Type remain as they are. If I choose yes, though, I get a fairly large warning saying:

This column will be removed from all content types that are based on this type. If you are sure you want to remove this column from all content types based on this type, click OK. To remove this column from this content type only, click Cancel to close this dialog box, click No in the Update Lists and Columns section, and then click Remove.

Snappy message that:

Silly Warning Dialog

Anyway, if you click OK, that column is removed from child content types. H0wever, the column is not deleted from lists that were using those child content types. I removed the ‘Job Title’ column from my ‘Example Travel Expenses’ site content type. If we return to our list settings page, we can see that the column still exists, although it isn’t used in any content types:

Extra List Columns 3

This makes sense, as the column could actually contain data, and it could be used in multiple places throughout our sites (potentially hundreds!) However, maybe you do want to remove that column from that list, or potentially those hundreds of lists. In that case (and this is why this is important) you have to delete the ‘orphan’ column on a list by list basis. Therefore, if your content type was used in hundreds of lists, you will have to delete this extra column hundreds of times, once for each list.

Therefore, be very careful when adding or removing columns from a Site Content Type – make sure that you really want to add it (as removing it might be hard), and be aware that removing the column is not the same as deleting it in the lists that use it already.

Advertisements
Take care when adding or removing columns from Site Content Types

8 thoughts on “Take care when adding or removing columns from Site Content Types

  1. Rodrigo says:

    Hello

    It is fine because you are deleting from the specific content type. What about if you are using that column for another content type as well?. To delete the column from site do this straigth from the settings screen, select the column and clic on delete, that’s it.

    Actually, I was looking for do the opposite … so you help me anyway

    Thanks!

    Like

  2. Well, we were using the column for another Content Type – which is why we did it!

    I’m not sure about the deleting the column from the site – I thought I tried this and still ended up with orphaned columns, but I’d need to check.

    I’m not sure I follow what you mean by the opposite? What are you trying do do?

    Like

  3. Rahul Babar says:

    Is there any way to delete such orphan columns because I am not getting any option to delete from the library.

    Thanks,
    Rahul Babar

    Like

  4. Hi Rahul,

    Normally you can!? I always could! I guess I wonder …

    a) is it used by another content type?
    b) does it allow deletion? (Some columns don’t)

    Like

  5. Lawrence says:

    Thank you for the post. I did notice that when I was working on a content type on a site. I thought the idea of a site content type is when you made changes it will automatically updated the existing content type on document libraries with the changes.

    I was thinking this is a bug… unless Microsoft thinks that all columns should be a metadata column… I don’t know but I think this is a bug…

    Lawrence

    Like

  6. Nope, I don’t think so. As I said, it makes sense as you don’t know what else refers to that column, and the column could still contain data!

    It is awkward, but it makes sense.

    Like

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