Hide Title Column in Custom SharePoint Lists

In one of my latest projects I was faced with the need to hide the OOTB Title column in a custom SharePoint list. Initially I thought this would be an easy job to be done within 2-3 minutes but it turned out I was wrong. I read several articles on the web, including a couple of discussions in MSDN forums dedicated to the exact same topic, but honestly none of the suggestions worked for me. Finally, I managed to find a working solution that I am glad to share with you, hoping it could be of help should you need to accomplish the same task.

The completed solution will provision a SharePoint list with a custom content type that has three fields and the Title column is hidden. For the sake of brevity I will highlight only the key artifacts comprising the sample, omitting details like the creation of custom fields and the deployment of a custom list with a feature.

Let’s start with the custom content type definition. Here as always we add fields that would appear in our list once we add the content type to it. We do not typically add the Title column to the content type explicitly but nevertheless it appears in the list. This happens because the root ancestor of every custom content type is the Item content type (ID=”0×01″) which includes the Title field in its definition. It’s worth to mention that the ID of Title field is always {fa564e0f-0c70-4ab9-b863-0177e6ddd247}, regardless of the SharePoint version, so you can reference it using this ID every time you need.

In order to hide the Title column, first we set the Inherits attribute of the content type element to “FALSE“. Then we include the Title column in the content type field references just like we do with custom fields. By default the Title column is required and visible in new and edit list forms, so we need to override this by setting the Hidden attribute to “TRUE” and the Required attribute to “FALSE“. Here is our content type definition:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent Content Type: Item (0x01) -->
  <ContentType ID="0x01009681BBDB479741D18A71EEBDC6333889"
               Name="ConsultantContentType"
               Group="Custom Content Types"
               Inherits="FALSE"
               Version="0">
    <FieldRefs>
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Hidden="TRUE" Required="FALSE" Name="Title" ShowInEditForm="FALSE" ShowInNewForm="FALSE" ShowInDisplayForm="FALSE"/>
      <FieldRef ID="{36C6A5A0-7A38-4730-A1B0-875627740590}" Name="Consultant"/>
      <FieldRef ID="{B5DEEFF1-299B-4F08-8E80-C2C4B9F24E52}" Name="ConsultantType"/>
      <FieldRef ID="{7C3F532E-0B36-4E3B-B21E-B05BC1D081AE}" Name="Rate"/>
    </FieldRefs>
  </ContentType>
</Elements>

You may wonder why we are not using the RemoveFieldRef element whose purpose is to remove an existing field from a content type? Well, in my tests the Title field was not successfully removed by using the RemoveFieldRef element.

Now let’s move to our custom list definition. We add the content type created above to our list by referencing it with with the ContentTypeRef element. Then we include all of our custom fields plus the field definition of the Title column in the Fields section. It’s very important for the Title field to be defined again with the following attributes: Required=”FALSE”, Hidden=”TRUE”, ShowInEditForm=”FALSE”, ShowInNewForm=”FALSE”, ShowInDisplayForm=”FALSE”:

<ContentTypes>
  <ContentTypeRef ID="0x01009681BBDB479741D18A71EEBDC6333889" />
</ContentTypes>
<Fields>
  <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Type="Text" Name="Title" DisplayName="$Resources:core,Title;" Required="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Title" MaxLength="255" ShowInEditForm="FALSE" ShowInNewForm="FALSE" ShowInDisplayForm="FALSE" Hidden="TRUE"/>
  <Field SourceID="http://schemas.microsoft.com/sharepoint/v3" ID="{36C6A5A0-7A38-4730-A1B0-875627740590}" Name="Consultant" StaticName="Consultant" DisplayName="Consultant" Type="User" Required="TRUE" Group="Consultant Custom Fields"></Field>
  <Field SourceID="http://schemas.microsoft.com/sharepoint/v3" ID="{B5DEEFF1-299B-4F08-8E80-C2C4B9F24E52}" Name="ConsultantType" StaticName="ConsultantType" DisplayName="Consultant Type" Type="Choice" Required="TRUE" Group="Consultant Custom Fields"  Indexed="TRUE" EnforceUniqueValues="TRUE">
    <CHOICES>
      <CHOICE>SharePoint Architect</CHOICE>
      <CHOICE>SharePoint Consultant</CHOICE>
      <CHOICE>SharePoint Developer</CHOICE>
      <CHOICE>SharePoint Administrator</CHOICE>
    </CHOICES>
    <Default>SharePoint Architect</Default>
  </Field>
  <Field SourceID="http://schemas.microsoft.com/sharepoint/v3" ID="{7C3F532E-0B36-4E3B-B21E-B05BC1D081AE}" Name="Rate"  StaticName="Rate" DisplayName="Rate" Type="Currency"  Required="TRUE" Group="Consultant Custom Fields"></Field>
</Fields>

We are almost ready. What is left is to modify all views of our custom list to not reference the OOTB Title and LinkTitle fields. However, by removing the LinkTitle column from the views, we are also effectively removing the Edit Control Block (ECB) menu. The good news is that we can still have the ECB menu in our views even when the Title column is hidden. To accomplish this we set LinkToItem=”TRUE” and ListItemMenu=”TRUE” attributes to one of our custom fields that are included in the view. Bellow is a code snippet of one of our views:

<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/15/images/generic.png" Url="AllItems.aspx">
  <Toolbar Type="Standard" />
  <XslLink Default="TRUE">main.xsl</XslLink>
  <JSLink>clienttemplates.js</JSLink>
  <RowLimit Paged="TRUE">30</RowLimit>
  <ViewFields>
    <FieldRef Name="Consultant" LinkToItem="TRUE" ListItemMenu="TRUE"></FieldRef>
    <FieldRef Name="ConsultantType"></FieldRef>
    <FieldRef Name="Rate"></FieldRef>
  </ViewFields>
  <Query>
    <OrderBy>
      <FieldRef Name="ID"></FieldRef>
    </OrderBy>
  </Query>
  <ParameterBindings>
    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
  </ParameterBindings>
</View>

Finally we deploy and the result is:

hide_title_img1

And the list view with the ECB menu attached to one of the custom fields:

hide_title_img3

You can download the full source code of the sample from here.

2 thoughts on “Hide Title Column in Custom SharePoint Lists

  1. Hi,
    Everything works fine, but Version History from Context Menu doesn’t work.
    It says “Item does not exist. It may have been deleted by another user.”. If you check the version history page (Versions.aspx) url in query string FileName is empty which is not the case when Title field is Link field (default).

Leave a Reply to A.Ragab Cancel reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>