Hide Site Settings Gear icon for users other than owners in SharePoint 2013/2016

Here we will discuss how to hide site settings or gear icon from users other than site owners in SharePoint 2013 or SharePoint 2016. There are various ways to hide site settings icon from SharePoint 2013/2016.

Here we will discuss trimming controls in SharePoint 2013 / SharePoint 2016 depending on logged in user.

Site setting gear icon will appear only for the logged-in user who is an owner or above in SharePoint 2013/2016. We will see how we can use spsecuritytrimmedcontrol in SharePoint 2013.

Hide Site setting gear icon in SharePoint 2013

In my application user want to hide the site setting gear icon/option for all the users other than site owners and above. As we all know that in SharePoint 2013 and SharePoint 2016 site settings gear icon is available for all the users.

If we want to achieve this across the site, we have to implement this change in the master page.

Check How to Change favicon in SharePoint Online/2013/2016

Implement SPSecurityTrimmedControl in SharePoint 2013/2016

Follow the below steps to update the master page to hide the gear icon in SharePoint 2013/2016.

  1. Open the SharePoint 2013 site using SharePoint designer 2013
hide site setting gear icon in sharepoint 2013
hide site setting gear icon in sharepoint 2013

2. Navigate to Master page part of All Files -> _catalogs

3. Identify your custom master page and check out in advanced mode

remove gear icon sharepoint 2013
remove gear icon sharepoint 2013

4. Look for <span class=”ms-siteactions-root” id=”siteactiontd”>

5. Copy the below code and paste right above that span tag.

<SharePoint:SPSecurityTrimmedControl runat="server" Permissions="ManageSubWebs">

After you add this line it will like as below and ensure that you close this tag properly.

hide site settings sharepoint 2013
hide site settings sharepoint 2013

Once you are done with your changes publish the latest master page and the output will be as follows:

Logged in user is site owner

Now if you logged into the SharePoint 2013 site as a SharePoint site owner, then you can see they can see the settings or gear icon like below:

how to hide the gear in sharepoint 2013
how to hide the gear in sharepoint 2013

Logged in user is a contributor:

Now if a user will logged in as a contributor then you can see the settings or gear icon in SharePoint 2013.

how to hide the gear in sharepoint 2016
how to hide the gear in sharepoint 2016

You can also verify the user has contribute permission to the SharePoint site.

SPSecurityTrimmedControl in SharePoint 2013/2016
SPSecurityTrimmedControl in SharePoint 2013/2016

You may like the following SharePoint customization tutorials:

Here in this SharePoint customization tutorial, I have explained how to use SPSecurityTrimmedControl in SharePoint 2013/2016. How to hide site settings SharePoint 2013 or hide the gear icon in SharePoint 2013/2016. Hope this helps, happy branding in SharePoint 2013 / 2016 !!!

  • So, something like the code below? “Read” users see “Sorry, no access” page when they try to access the site. What am I doing wrong?

    <SharePoint:SiteActions runat="server" accesskey="”
    id=”SiteActionsMenuMainData”
    PrefixHtml=””
    SuffixHtml=””
    ImageUrl=”/_layouts/15/images/spcommon.png?rev=40″
    ThemeKey=”spcommon”
    MenuAlignment=”Right”
    LargeIconMode=”false”
    >

    <SharePoint:MenuItemTemplate runat="server"
    id="MenuItem_ShareThisSite"
    Text="”
    Description=””
    MenuGroupId=”100″
    Sequence=”110″
    UseShortId=”true”
    PermissionsString=”ViewPages”
    PermissionMode=”Any” />
    <SharePoint:MenuItemTemplate runat="server" id="MenuItem_EditPage"
    Text="”
    Description=””
    ImageUrl=”/_layouts/15/images/ActionsEditPage.png?rev=40″
    MenuGroupId=”200″
    Sequence=”210″
    PermissionsString=”EditListItems”
    ClientOnClickNavigateUrl=”javascript:ChangeLayoutMode(false);” />
    <SharePoint:MenuItemTemplate runat="server" id="MenuItem_CreatePage"
    Text="”
    Description=””
    ImageUrl=”/_layouts/15/images/NewContentPageHH.png?rev=40″
    MenuGroupId=”200″
    Sequence=”220″
    UseShortId=”true”
    ClientOnClickScriptContainingPrefixedUrl=”OpenCreateWebPageDialog(‘~siteLayouts/createwebpage.aspx’)”
    PermissionsString=”AddListItems, EditListItems”
    PermissionMode=”All” />
    <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create"
    Text="”
    Description=””
    MenuGroupId=”200″
    Sequence=”230″
    UseShortId=”true”
    ClientOnClickScriptContainingPrefixedUrl=”GoToPage(‘~siteLayouts/addanapp.aspx’)”
    PermissionsString=”ManageLists, ManageSubwebs”
    PermissionMode=”Any” />
    <SharePoint:MenuItemTemplate runat="server" id="MenuItem_ViewAllSiteContents"
    Text="”
    Description=””
    ImageUrl=”/_layouts/15/images/allcontent32.png?rev=40″
    MenuGroupId=”200″
    Sequence=”240″
    UseShortId=”true”
    ClientOnClickNavigateUrl=”~siteLayouts/viewlsts.aspx”
    PermissionsString=”ViewFormPages”
    PermissionMode=”Any” />
    <SharePoint:MenuItemTemplate runat="server" id="MenuItem_ChangeTheLook"
    Text="”
    Description=””
    MenuGroupId=”300″
    Sequence=”310″
    UseShortId=”true”
    ClientOnClickNavigateUrl=”~siteLayouts/designgallery.aspx”
    PermissionsString=”ApplyThemeAndBorder,ApplyStyleSheets,Open,ViewPages,OpenItems,ViewListItems”
    PermissionMode=”All” />
    <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Settings"
    Text="”
    Description=””
    ImageUrl=”/_layouts/15/images/settingsIcon.png?rev=40″
    MenuGroupId=”300″
    Sequence=”320″
    UseShortId=”true”
    ClientOnClickScriptContainingPrefixedUrl=”GoToPage(‘~siteLayouts/settings.aspx’)”
    PermissionsString=”EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData”
    PermissionMode=”Any” />
    <SharePoint:MenuItemTemplate runat="server" id="MenuItem_SwitchToMobileView"
    Visible="false"
    Text="”
    Description=””
    MenuGroupId=”300″
    Sequence=”330″
    UseShortId=”true”
    ClientOnClickScript=”STSNavigate(StURLSetVar2(ajaxNavigate.get_href(), ‘mobile’, ‘1’));” />

  • Hi I’m trying the above solution as it sounds quite straight forward, however I’m slightly confused on point 3. How do I know which is my custom master page?

    In the location ‘./_catalogs/masterpage’ I have the following files:

    minimal.master
    oslo.master
    oslo.preview
    seattle.master
    seattle.preview
    v4.master

    Only ‘oslo.master’ has the ” but if I make the above change in this I get the following error message:

    Site Definition Page Warning
    Saving your changes will customize this page so that it is no longer based on the site definition. Do you want to continue?

    Please advise?

  • >