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 lists, libraries, apps, and subsites of the site. If you want to hide site contents link in SharePoint Online quick launch navigation, do the following:
  • Navigate to your modern SharePoint Online site
  • Click on "Edit" link under the quick launch navigation.
    sharepoint online hide site contents from quick launch
  • Click on the little three dots next to the "Site contents" menu item to get its context menu.
  • Select "Remove" from the context menu.remove site contents from sharepoint online
  • Click on Save button to hide site contents from the quick launch
Now, "Site Contents" won't be listed in Quick Launch navigation in SharePoint Online site!

Restrict Access to Site Contents in SharePoint Online:
How about hiding site contents from all users, except specific SharePoint Group? Well, When you have publishing feature enabled, You can either Remove or restrict the site contents link from users based on user group. Make sure you have activated SharePoint Server Publishing Infrastructure at both Site collection and Site levels before proceeding.
  • Click on Settings gear >> Select Site Settings.
  • Click on "Navigation" link under "Look and Feel"
  • Select "Site contents" under Structural Navigation and Click on "Edit" link.
    hide site contents in sharepoint online
  •  Set the Audience targeting to required SharePoint Group.
    sharepoint online restrict access to site contents
  • 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?

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.