Hide Button from SharePoint Ribbon

This post covers, how to hide the button from the Server Ribbon from SharePoint 2010,

We are going to use the Feature files to hide the SharePoint 2010. First we will create a Feature file and then we’ll create a element file.

Feature.xml

<?xml version="1.0" encoding="utf-8"?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
    Description="Remove the Button from Server Ribbon"
    Id="5469fb99-2665-46f6-b659-bf6a0117a854"
    Scope="Web"
    Title="Hide Ribbon Button">
  <ElementManifests>
    <ElementManifest Location="Elements.xml" />
  </ElementManifests>
</Feature>

 

Elements.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <HideCustomAction 
      HideActionId = "<Location ID of Button>"
      Id = "<Id>"
      Location = "<Button Parent Location ID>">
  </HideCustomAction>
</Elements>

 

There was a HideCustomAction element used to hide / remove the button from Server Ribbon Control. If we want to remove particular Button / Group / Tab we have to specify the respective Button’s Location ID on HideActionId attribute.

HideActionId – Specifies the Location ID of the custom action to hide

Location – Specifies the Parent location Id of the custom action to hide.

By using HideCustomAction, we can hide / remove the Button, Group, Tab.

Example

For example I have provided a element.xml for hiding the Upload Multiple button from the Document Library.

Elements.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <HideCustomAction 
      HideActionId = "Ribbon.Documents.New.AddDocument.Menu.Upload.UploadMultiple"
      Id = "RemoveRibbonUploadMultiple"
      Location = "CommandUI.Ribbon">
  </HideCustomAction>
</Elements>

The above xml file, used to remove the Upload Multiple Documents from the Server ribbon on Document Libraries.

I have added the code in codplex, http://iotapsp.codeplex.com/

Shantha Kumar
Shantha Kumar
Articles: 278

24,849 Comments

  1. Hi,I like your blog’s theme. I too am interested in the same teongolchies as you do. Matter of fact, we’re shifting to MS SP 2007 now to handle all of our online web applications.It is my first time to deal with MS SP, I really would appreciate any thoughts that you might have with regards to what components we’ll need to setup and run the website. I’d love to read any recommendations that you think would help in this project.Hope to see you post again soon.

Comments are closed.