Hide a Button in SharePoint Online List or document library Toolbar

Requirement: Hide a Button (E.g. New, Upload, Share, etc.) in SharePoint Online.

How to hide “New” button in SharePoint Online List View?

Have you ever wanted to hide a button from the SharePoint Online list or document library? E.g. You may want to hide the new button in the SharePoint Online list view. In this post, we’ll show you how to do it using some simple list view formatting. With just a few lines of JSON code, you can easily hide any button on your SharePoint Online list.

Do the following to hide a button from SharePoint Online list view using list view formatting:

  • Navigate to the list or document library >> Click on the View dropdown and choose “Format current view” >> Click on “Advanced Mode”
  • Paste the JSON below to hide the New button from the toolbar.hide button in list toolbar sharepoint online
{
  "commandBarProps" : {
    "commands": [
      {
        "key": "new",
        "hide": true
      }    
    ]
  }
}

Here is the result:

The command bar customization method can be used not only for hiding a button but also to rename the button text, replace the icon, change the order of the buttons, etc. More here: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

8 thoughts on “Hide a Button in SharePoint Online List or document library Toolbar

  • Awesome, easiest solution in the internet

    Reply
  • Found the answer to my previous question here https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting

    Reply
  • Also would it be possible to use a similar method to hide the submenu item ‘Folder’ from the Upload menu?

    Reply
  • Hi – this is a fantastic tip. You will need to do this to each view on the list if the requirement is to not have New seen at all. I wish there was a SharePoint List setting to do this override.

    One thing to improve instruction above is include the missing dot point after Format Current View “Click Advanced mode”

    Thank you for this incredible site. I have had countless benefits from all the Powershell samples.

    Reply
  • This is super helpful. I’m trying to hide the button to open the details pane, but I don’t think there is a key reference for that button. Do you know if this is possible at all?

    Reply
    • You can turn off “Quick property editing” from the List settings >> Advanced settings to make the details pane read-only. Hiding the button using CSS is also possible.

      Reply
  • This is amazing! Thanks for sharing!

    Reply

Leave a Reply

Your email address will not be published.