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/

One thought on “Hide Button from SharePoint Ribbon

Leave a 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>