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.
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.
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
2. Navigate to Master page part of All Files -> _catalogs
3. Identify your custom master page and check out in advanced mode
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.
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 the 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
- Customize access denied page in SharePoint 2013
- Ribbon control missing for list in SharePoint Online
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 !!!
I am Krishna.Vandanapu a SharePoint architect working in IT from last 13+ years, I worked in SharePoint 2007, 2010, 2013, 2016 and Office 365. I have extensive hands on experience in customizing SharePoint sites from end to end. Expertise in SharePoint migration tools like Sharegate, Doc Ave and Metalogix. Migrated SharePoint sites from SharePoint 2007 to 2010 and 2010 to 2013 several times seamlessly. Implementing CSOM with Microsoft best practices. Spent quality time in configuring SharePoint application services like User Profile, Search, Managed Meta data services etc. Now exploring SharePoint Framework and SharePoint 2019