{"id":1259,"date":"2013-03-17T15:36:14","date_gmt":"2013-03-17T15:36:14","guid":{"rendered":"http:\/\/www.stuartroberts.net\/?p=1259"},"modified":"2013-03-17T15:36:14","modified_gmt":"2013-03-17T15:36:14","slug":"hide-sharepoint-ribbon-items","status":"publish","type":"post","link":"http:\/\/www.stuartroberts.net\/index.php\/2013\/03\/17\/hide-sharepoint-ribbon-items\/","title":{"rendered":"Hide SharePoint Ribbon Items"},"content":{"rendered":"<p>To hide a menu item from the SharePoint ribbon add a custom action to a module in your Visual Studio SharePoint project:<\/p>\n<pre lang=\"xml\">\r\n<CustomAction\r\nId=\"CustomIdentifier.Ribbon.Documents.New.NewFolder.Hide\"\r\nLocation=\"CommandUI.Ribbon\" RegistrationType=\"ContentType\" RegistrationId=\"0x\">\r\n  <CommandUIExtension>\r\n    <CommandUIDefinitions>\r\n      <CommandUIDefinition Location=\"Ribbon.Documents.New.NewFolder\">\r\n      <\/CommandUIDefinition>\r\n    <\/CommandUIDefinitions>\r\n  <\/CommandUIExtension>\r\n<\/CustomAction>\r\n<\/pre>\n<p>The example above will hide the New Folder ribbon menu item for all document libraries.<\/p>\n<p>Using a <em>RegistrationType<\/em> of <em>ContentType<\/em> and <em>RegistrationId<\/em> of <em>0x<\/em> means it will be applied to all items.<br \/>\n<!--more--><br \/>\nThe important part of the custom action is specifying the item&#8217;s location, which above is:<\/p>\n<pre lang=\"xml\">\r\n<CommandUIDefinition Location=\"Ribbon.Documents.New.NewFolder\">\r\n<\/CommandUIDefinition>\r\n<\/pre>\n<p>Notice there&#8217;s nothing defined within the <em>CommandUIDefinition<\/em>, doing this hides the menu item.<\/p>\n<p>An easy way to find out the <em>Location<\/em> identifier is to open the list or library in IE and open the <em>Developer Tools<\/em> ad-on &#8211; F12 key by default.  Using <em>Select item by click<\/em> (ctrl + b) select the ribbon item you want and the <em>Location<\/em> identifier will be in the id attribute of the selected item, as shown below:<\/p>\n<p><a href=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2013\/03\/17-03-2013-15-29-36.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2013\/03\/17-03-2013-15-29-36.jpg\" alt=\"Ribbon Identifier\" width=\"993\" height=\"486\" class=\"aligncenter size-full wp-image-1410\" srcset=\"http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2013\/03\/17-03-2013-15-29-36.jpg 993w, http:\/\/www.stuartroberts.net\/wp-content\/uploads\/2013\/03\/17-03-2013-15-29-36-300x146.jpg 300w\" sizes=\"(max-width: 993px) 100vw, 993px\" \/><\/a><\/p>\n<p>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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To hide a menu item from the SharePoint ribbon add a custom action to a module in your Visual Studio SharePoint project: The example above will hide the New Folder ribbon menu item for all document libraries. Using a RegistrationType &hellip; <a href=\"http:\/\/www.stuartroberts.net\/index.php\/2013\/03\/17\/hide-sharepoint-ribbon-items\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[3],"tags":[59,81],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/plx2I-kj","_links":{"self":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1259"}],"collection":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/comments?post=1259"}],"version-history":[{"count":9,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1259\/revisions"}],"predecessor-version":[{"id":1413,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/posts\/1259\/revisions\/1413"}],"wp:attachment":[{"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/media?parent=1259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/categories?post=1259"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.stuartroberts.net\/index.php\/wp-json\/wp\/v2\/tags?post=1259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}