Hide SharePoint Ribbon Items

To hide a menu item from the SharePoint ribbon add a custom action to a module in your Visual Studio SharePoint project:

Location="CommandUI.Ribbon" RegistrationType="ContentType" RegistrationId="0x">
      <CommandUIDefinition Location="Ribbon.Documents.New.NewFolder">

The example above will hide the New Folder ribbon menu item for all document libraries.

Using a RegistrationType of ContentType and RegistrationId of 0x means it will be applied to all items.

The important part of the custom action is specifying the item’s location, which above is:

<CommandUIDefinition Location="Ribbon.Documents.New.NewFolder">

Notice there’s nothing defined within the CommandUIDefinition, doing this hides the menu item.

An easy way to find out the Location identifier is to open the list or library in IE and open the Developer Tools ad-on – F12 key by default. Using Select item by click (ctrl + b) select the ribbon item you want and the Location identifier will be in the id attribute of the selected item, as shown below:

Ribbon Identifier

The identifier is everything up to but not including the last dash character (-), so in this example it is Ribbon.Documents.New.NewFolder and not Ribbon.Documents.New.NewFolder-Large.

This entry was posted in SharePoint and tagged , . Bookmark the permalink.

One Response to Hide SharePoint Ribbon Items

  1. Aditya Reddy says:

    Thanks. This was worked like charm. Appreciated by my leads too.

Leave a Reply

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

Solve the maths problem shown below before posting: *