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:

  1. Navigate to your modern SharePoint Online site.
  2. Click on the “Edit” link under the quick launch navigation.
    sharepoint online hide site contents from quick launch
  3. Click on the little three dots next to the “Site contents” menu item to get its context menu.
  4. Select “Remove” from the context menu.remove site contents from sharepoint online
  5. 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:

  1. Click on Settings gear >> Select Site Settings.
  2. Click on the “Navigation” link under “Look and Feel”
  3. Select “Site contents” under Structural Navigation and Click on the “Edit” link.
    hide site contents in sharepoint online
  4.  Set the Audience targeting to the required SharePoint Group.
    sharepoint online restrict access to site contents
  5. 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?

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

2 thoughts on “SharePoint Online: Hide Site Contents Link from Quick Launch

  • 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

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *