Saturday, July 30, 2016

Hide Title column from a SharePoint list using PowerShell

There are a number of times where you may not want the Title column to appear in a list. It is not recommended to delete the Title column, but the following PowerShell script hides it from view in the View and Edit Item pages and also the List Settings page. Note: You will still need to remove it from all list views.

#Get web object
$web = Get-SPWeb -identity "http://portal/testsite"

#Get list and Title column
$list = $web.Lists["TestList"]
$titleColumn = $list.Fields["Title"]

#Set Title to optional and hidden
$titleColumn.Required = $false
$titleColumn.Hidden = $true

#Update Title column and list
$titleColumn.Update()
$list.Update()

#Dispose of Web object
$web.Dispose()

3 comments: