How can I hide the SharePoint Suite and Ribbon Bars based on specific groups and permissions?

By default, the suite bar is visible to all users accessing your SharePoint page. However, in certain scenarios, it may be useful to remove the Suite bar based on the user permissions and/or associated groups. 

By utilizing BindTuning themes, you'll be granted the ability to enable and disable this same feature at will.

spbars.png

Modern SharePoint

To show and/or hide the Suite Bar on your Modern SharePoint Site, follow the steps below: 

  1. Access your required site collection; 
  2. On the ribbon, select the button BindTuning Settings;
  3. Under General, scroll to the bottom of the panel until you find the Hide Ribbon option; 
  4. Navigate to the option Hide Ribbon People.

settings-panel.png

 

In this particular setting, you'll be able to input both individual users, as well as correlative SharePoint Groups, to whom you want the Suite Bar not to appear.

users-and-groups.PNG

Classic SharePoint

Whereas the Modern experience is constituted solely by the Suite Bar, Classic SharePoint sites have access to the Ribbon Bar, which provides the ability to Share, Follow and Edit your classic pages. The following steps will provide a detailed explanation on how to remove both the Suite and Ribbon bars, on the classic experience.

suite-ribbon-bar.png

Info: SharePoint Designer is required in order to accomplish the steps described in this article. If you need to download it please follow this link.

Hiding the Suite Bar

  1. Open your site with SharePoint Designer;
  2. Edit the masterpage:
    • Sandbox solution: go to All files > _catalogs > masterpages > THEMENAME
    • Farm solution: go to All files > _catalogs > masterpages
  3. Check out and edit in advanced mode the master page you are using;
  4. Look for the comment
    <!--SuiteBar start-->
  5. Right before it paste the line bellow
    <Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="ManageWeb">
  6. Look for the comment
    <!--SuiteBar end-->
  7. Just below it, paste the following code
    </SharePoint:SPSecurityTrimmedControl>

In this particular scenario, we have made the ribbon bar visible to users whose permissions fell under the ManageWeb membership. However, this trim control can be applied to other levels. The full list of permission values can be found here.

Hiding the ribbon bar

 

The SPSecurityTrimmedControl applied above,  removed the suite bar but could not be used to remove the ribbon bar because SharePoint uses this element to calculate the scroll on the page.
The ribbon bar has to be hidden using a small script.
  1. Open your site with SharePoint Designer;
  2. Edit the masterpage;
    • Sandbox solution: go to All files > _catalogs > masterpages > THEMENAME
    • Farm solution: go to All files > _catalogs > masterpages
  3. Check out and edit in advanced mode the master page you are using;
  4. Look for the comment
    <!--Ribbon end-->
  5. Right below it, paste the following script:
    • For Office 365, SharePoint 2019, and SharePoint 2016
                      <script type="text/javascript">
                        var suitebar = $("#suiteBarDelta");
                        if(suitebar.length<1)
                           $("#s4-ribbonrow").css('display','none');
                      </script>
                      
    • For SharePoint 2013
                          <script type="text/javascript">
                            var suitebar = $("#suiteBar");
                            if(suitebar.length<1)
                               $("#s4-ribbonrow").css('display','none');
                          </script>
                      
Have more questions? Submit a request

Comments

  • Avatar
    Ddpvanoerle

    Hello João,

    thanks for the instruction.

    One question now: How do I get in for editing the pages?

    Even when I logged in to the main administrator screen, I am not able to get into editing the pages of the site.

    When I click on the button publice site I get the normal site, without the suit bar to log me in.

    I thought the trim was there to give me as a loggedin the entrance to edit the site pages

  • Avatar
    Ddpvanoerle

    I have made a button for "editing public site" See attachement.

    I have put this link in it:

    https://dirkvanoerle1-public.sharepoint.com/_layouts/15/authenticate.aspx?Source=/

    Only with this i can access the editing mode of the site

  • Avatar
    Joao Ferreira

    Hi,

     

    If you hide the suite bar and the ribbon bar, to get the edit options back you have to access to your site using the https version.

  • Avatar
    Adrian Pearson

    Hi Joao,

    Do the above instructions apply to the public website too?

    Clearly, we would not want the Suite Bar to show for anonymous browsers on the public website.

    Or will the Suite Bar automatically disappear when we apply our custom domain name?

    Regards

    Adrian

  • Avatar
    Joao Ferreira

    Hi Adrian,

    Those instructions are valid also for the public website, if you want to hide the bars you have to apply it.

     

    Regards

    ,

     

    João Ferreira

  • Avatar
    Adrian Pearson

    Thanks for the clarification Joao, however, when I follow your instructions they have no effect - my IT person here thinks that I am not editing the correct master page.

    I used this fix  http://support.bind.pt/entries/24005423-Edit-page-properties-on-Public-Facing-web-sites-from-Office-365-2013 before and wonder if that is affecting this second fix?

    Attached is a screen clip, showing the file I am editing.

  • Avatar
    Joao Ferreira

    Hi Adrian,

    You are editing the correct master page but don't forget that you always have to check out the master and then check in and publish the major version, other wise the changes will be only visible for the user that made it.

  • Avatar
    Adrian Pearson

    My IT guy has found a second copy of the masterpage which for some reason isn't showing up in the masterpages list (but is showing up in the All Files list). He reckons that this one is the one that we'll need to edit to make the change. Is there a way for you to check this please before we make any changes? It doesn't look like this theme has been installed correctly?

  • Avatar
    Joao Ferreira

    Hi Adrian,

    The master pages are located under All files ->  _catalogs/masterpages/MetroMadeInHeavenmasters/, the theme includes two masterpages one with side bar and one without it, your site is using the master without side bar.

    Can you please tell me what is the path of the master you found?

  • Avatar
    Adrian Pearson

    I just opened the masterpages folder in the left sidebar in SharePoint Designer (I sent the screen clip) but it seems going via All Files reveals the extra masterpage, even tough it appears to be the same folder. Thanks for the confirmation.

  • Avatar
    Hitesh

    HI Joao

    Is it possible to remove this bar or edit it so I can stick my own links on instead of Office365?

  • Avatar
    Joao Ferreira

    Hi Hitesh,

     

    It is possible but you have to create a custom script to change the bars.

    You can follow this article as a starting point http://academy.bindtuning.com/customize-sharepoint-2013-and-office-365-suite-bar/

     

    My best,

     

    João Ferreira

  • Avatar
    Scott Stafford

    If using the seattle.master, then where would the code go to hide the suite bar?

    Thanks.

  • Avatar
    Anne Coles

    Using the above code, I found the only users able to see the Suite Bar were administrators.  I only wanted anonymous users not to see the Suite Bar on my Public Site so I used this code: 

     

    At start of suite bar <!--SuiteBar start--> add this

    <Sharepoint:SPSecurityTrimmedControl runat="server" AuthenticationRestrictions="AuthenticatedUsersOnly">

     

    At end of suite bar <!--SuiteBar end--> add this

    /SharePoint:SPSecurityTrimmedControl

     

    I though others might find this useful.

  • Avatar
    John Monkhouse

    This is great, just what I was looking for thanks.

    Is there any way to create a link that will bring the ribbon back so we can edit the page?

BindTuning logo
Copyright Ⓒ 2021 Bind.
All rights reserved.
Privacy Policy
Cookie Policy
BindTuning
              Linkedin BindTuning Twitter BindTuning YouTube BindTuning Instagram BindTuning
              Facebook
Powered by Zendesk