Here we will discuss how we can 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.
SharePoint 2016 Tutorial Contents
In my application user want to hide the site setting gear icon/option for all the user 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 master page.
Follow the below steps to update the master page to hide the gear icon in SharePoint 2013/2016.
- Open the SharePoint 2013 site using SharePoint designer 2013
- Navigate to Master page part of All Files -> _catalogs
- Identify your custom master page and check out in advanced mode
- look for <span class=”ms-siteactions-root” id=”siteactiontd” >
- Copy the below code and paste right above that span tag
<SharePoint:SPSecurityTrimmedControl runat=”server” Permissions=”ManageSubWebs”>
After u add this line it will like as below and ensure that you close this tag properly.
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:
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.
You can also verify the user has contribute permission to the SharePoint site.
You may like following SharePoint customization tutorials:
- SharePoint 2016 usage analytics
- Approve/Reject documents or items using Content Approval in SharePoint Online or SharePoint 2016/2013
- Rating and Generate File plan Report in SharePoint 2013/2016 Document Library
- SharePoint 2013 Add Recycle Bin link in the quick launch
- Change default name in Suite Bar in SharePoint 2013/2016 and SharePoint Online
- Customize access denied page in SharePoint 2013
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 !!!
You May Also like the Following SharePoint Tutorials: