I'm trying to hide the "Upload Document" button (including the Upload Document and Upload Multiple Documents submenu). I've tried the following XML, but I can't get it to work:
<CustomAction
Id="RemoveRibbonButton"
Location="CommandUI.Ribbon">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.Documents.New.AddDocument" />
</CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>
<CustomAction
Id="RemoveRibbonButton"
Location="CommandUI.Ribbon"
RegistrationId="0x0101"
RegistrationType="ContentType">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.Documents.New.AddDocument" />
</CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>
Doing this removes the submenu, but makes the "New Folder" button, which I also have hidden, reappear:
<CustomAction
Id="RemoveRibbonButton"
Location="CommandUI.Ribbon"
RegistrationId="0x0101"
RegistrationType="ContentType">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.Documents.New.AddDocument.Menu.Upload" />
</CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>
I want this button hidden because we have made our own file upload control and button and we no longer want the default SharePoint one to display.
EDIT: Just to clarify, I need the solution to be via XML. All of our Ribbon customizations are via XML, so using server-side code or CSS/JavaScript is not an option.