SharePoint 2013: How to hide site contents
Introduction
How to hide "Site Contents" option from settings in SharePoint 2013 for non-admin user. Sometimes it comes into picture for security purposes that the end user should not have the access to site contents option.
Implementation
Step 1: Create a new custom permission level with "Add" and "View" permission only.
Step 2: Create a new custom SharePoint Group. Add users into this group as "Everyone except external users" or any particular username from which you want to hide the "Site Contents" option.
Step 3: Associate this newly created group with your custom permission level created in Step 1
Step 4: Find this: "MenuItem ViewAllSiteContents" text everywhere in your master page. Replace the text "ViewFormPages" with the text "EnumeratePermissions" within <SharePoint:MenuItemTemplate> tag. See the below example.
Step 5: Save the master page and get it tested by a non-admin user. You will see that the Site Contents option remains unavailable.
Example
<SharePoint:MenuItemTemplate runat="server" id="MenuItem_ViewAllSiteContents"
Text="<%$Resources:wss,quiklnch_allcontent_15%>"
Description="<%$Resources:wss,siteactions_allcontentdescription%>"
ImageUrl="/_layouts/15/images/allcontent32.png?rev=38"
MenuGroupId="200"
Sequence="240"
UseShortId="true"
ClientOnClickNavigateUrl="~siteLayouts/viewlsts.aspx"
PermissionsString="ViewFormPages"
<!-- Please replace this "ViewFormPages" text by "EnumeratePermissions" text to hide the "Site Contents" option for non-admin users-->
PermissionMode="Any" />