SharePoint Content Type ID GUID’s – Parent and Child

If you are looking to work with Content Types in SharePoint programmatically, you should understand the naming conventions used to compose the ID’s.

A content type’s ID shows inheritance. This is based on string concatenation with ’00’ as the seperator. This is generally in the form ‘0x[baseID]00[GUID (new id)]00[and so on]‘.

As an example, the ID of the built-in content type Item is 0x01. When inheriting from it, an example custom content type would be 0x010100E0D3BD7003DA22419C52027ABF151.
You will notice the custom content type ID starts with the ID for Item (0x01) followed by the ’00’ separator and then the GUID assigned to this content type.To find the parent of any content type, all that is needed is to split that content types ID on the separator ’00’ and examine the inheritance chain.


Using this convention, you can determine not only what content types a content type inherits from, but at which point two content types have common ancestors.
The following figure shows the relationship of the four content types detailed in the previous diagram. In each content type, the unique portion of the content type ID is represented by blue text:

PowerShell can be used if you don’t have a development tool to look Content Type ID’s automatically. Below is a PowerShell script to get you the IDs of all content types on a site:

$site = Get-SPSite http://mysite.myfarm.com
$web = $site.RootWeb
ForEach($ctype in $web.ContentTypes){write-host $ctype.Name": "$ctype.ID}
Sample Output:

References:
Content Type ID’s – MSDN:
http://msdn.microsoft.com/en-us/library/aa543822.aspx
Content Type Element (ContentType) – Technet:
http://msdn.microsoft.com/en-us/library/aa544268.aspx
Standardize Data Management with Content Types:
http://technet.microsoft.com/en-us/magazine/2008.02.contenttypes.aspx

child, content type, ctype, parent

Leave a Reply

Your email address will not be published. Required fields are marked *