SharePoint Online: Hide Site Contents Link from Quick Launch
Requirement: Hide site contents from quick launch in SharePoint Online.
How to Remove Site Contents from Quick Launch?
The Site Contents page in SharePoint Online provides a comprehensive view of all site lists, libraries, apps, and subsites. If you want to hide the site contents link in SharePoint Online quick launch navigation, do the following:
- Navigate to your modern SharePoint Online site.
- Click on the “Edit” link under the quick launch navigation.
- Click on the little three dots next to the “Site contents” menu item to get its context menu.
- Select “Remove” from the context menu.
- Click on the Save button to hide site contents from the quick launch
Now, “Site Contents” won’t be listed in Quick Launch navigation on SharePoint Online site!
Restrict Access to Site Contents in SharePoint Online:
How about hiding site contents from all users, except a specific SharePoint Group? Well, When you have the publishing feature enabled, You can either remove or restrict the site contents link from users based on the user group. Make sure you have activated SharePoint Server Publishing Infrastructure at both Site collection and site levels before proceeding. Here is how to hide site contents in SharePoint Online:
- Click on Settings gear >> Select Site Settings.
- Click on the “Navigation” link under “Look and Feel”
- Select “Site contents” under Structural Navigation and Click on the “Edit” link.
- Set the Audience targeting to the required SharePoint Group.
- This hides site contents link from all users except the one specified in Audience targeting.
Hide Site Contents in SharePoint Online with CSS
If you are still using classic experience, you can add this CSS either to your master page or at page level using the script editor web part.
<style>
span.ms-splinkbutton-text {
Display:none!important;
}
#sideNavBox a[href$="/_layouts/15/viewlsts.aspx"] {
display: none;
}
</style>
In modern team sites, use this CSS to remove site contents from SharePoint Online:
<style>
.ms-Nav-navItem a[href$="/_layouts/15/viewlsts.aspx"] {
display: none;
}
</style>
Here is my another post on removing site contents from quick launch: How to Hide Site Contents from Quick Launch in SharePoint?
Hi Salaudeen,
I love your article. This is exactly what I’m trying to do, however I want to hide the Site contents on all pages on the SharePoint sites. Hence I’m assuming I have to update the master page. Which master page do I need to update? I can see the following 4:
minimal.master
oslo.master
seattle.master
v4.master
Additional, I wish to allow the site contents to not be hidden for a single Admin page which is on accessible by admin users. How would I be able to achieve this?
Thanking you in advance.
G
Well, Modifying master pages is no longer a recommended approach in SharePoint Online! Hence, I would suggest to use SPFx solutions to inject CSS to the site. Here is my other article to help: How to Add Custom CSS to Modern SharePoint Online Sites?