How to Hide a Content Type from New Button Dropdown in SharePoint?

Requirement: Hide a Content Type from the new button drop-down in SharePoint.

How to make a Content Type Hidden in SharePoint?

In SharePoint, when you add a new content type to a library, it will be added to the New button dropdown in the ribbon. If you want to hide a content type from the New button dropdown, here is how:

To hide a content type from the new menu in SharePoint,

  1. Go to the SharePoint Online site where the list is located.
  2. Navigate to the List >> Click on Settings >> List Settings >> Under “Content Types”, click on the “Change new button order and default content type” link.
    sharepoint hide content type from new button
  3. Set the “Visible” flag to False by unchecking the tick mark. You can also change New Button Order.
    sharepoint online hide content type dropdown

This hides the content type in SharePoint.

SharePoint PowerShell to Hide a Content Type

We can also use PowerShell to hide a content type from the new menu in SharePoint.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Set config variables
$WebURL="https://intranet.crescent.com/"
$ListName ="Projects"
$ContentTypeName="Project Template"

#Get Web and Objects
$Web = Get-SPWeb $WebURL
$List = $Web.Lists[$ListName]

#Get the content type
$ContentType = $List.ContentTypes[$ContentTypeName]
$ContentType.Hidden = $True
$ContentType.Update()

Write-Host "Content Type Hidden from the List!"

This hides the content type from the new menu dropdown.

SharePoint Online: Hide Content Type dropdown using PowerShell

Similarly, to hide a content type in SharePoint Online, we can use this PowerShell script:

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

#Config Parameters
$SiteURL="https://crescent.sharepoint.com"
$ListName="Contacts"
$ContentTypeName="Business Contacts"

Try {
    #Get Credentials to connect
    $Cred= Get-Credential

    #Setup the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
        
    #Get the content type from the List
    $List = $Ctx.Web.Lists.GetByTitle($ListName)
    $Ctx.Load($List)
 
    #Get the content type from list
    $ContentTypeColl = $List.ContentTypes
    $Ctx.Load($ContentTypeColl)
    $Ctx.ExecuteQuery()
 
    #Get the content type to Hide
    $CType = $ContentTypeColl | Where {$_.Name -eq $ContentTypeName}
    If($CType -ne $Null)
    {
        $CType.Hidden=$True
        $CType.Update($False)
        $Ctx.ExecuteQuery()

        Write-host "Content Type is Set to Hidden!" -ForegroundColor Green
    }
    else
    {
        Write-host "Content Type Doesn't Exist!" -ForegroundColor Yellow
    }
}
Catch {
    write-host -f Red "Error Setting Conent Type to Hidden!" $_.Exception.Message
}

PnP PowerShell to Hide a Content Type in SharePoint Online List:

Here is how to hide content type from the new dropdown in SharePoint Online.

$SiteURL = "https://crescent.sharepoint.com/sites/marketing"
$ListName = "Contacts"
$ContentTypeName ="Business Contacts V2"

#Connect to Pnp Online
Connect-PnPOnline -Url $SiteURL -Interactive
 
#Get the Context
$Context = Get-PnPContext
 
#Get the content type from List
$ContentType = Get-PnPContentType -Identity $ContentTypeName -List $ListName
 
#Set content type to hidden
$ContentType.Hidden = $True
$ContentType.Update($False)
$Context.ExecuteQuery()

Hiding a content type in a SharePoint list will not remove the content type from the site collection or from any other lists where it is used. If you want to remove a content type from the site collection entirely, you must delete it from the site collection content type gallery.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

3 thoughts on “How to Hide a Content Type from New Button Dropdown in SharePoint?

  • The way of hiding same content type in multiple libraries in the site/s

    Reply
  • Do you have PnP script for this?

    Reply

Leave a Reply

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