0

I have subsites within a site collection that are still displaying "Site Contents" in their site navigation. I have tried to recreate this issue by creating new subsites but the "Site Contents" appears within the Quick Launch so I'm able to remove it.

Here is what an impacted Left Nav looks like:

Impacted Left NavSite Navigation

Here's what I normally see people talk about in other forums.

Editing Normal Quick Launch

I've seen people talk about adding CSS code to a site or the master page of a site. I've tried to do both but the site contents is still there. Not sure if any one else has had this issue, it seems like other forum threads about this topic have started and stopped about 4 years ago.

I don't know if I've been applying the CSS wrong, just looking for a way to have this site contents option removed.

1 Answer 1

1

The current user rights are actually the key factor in whether the Site Contents is displayed.

If the user already has View Application Pages - View forms, views, and application pages. Enumerate lists., the Site Contents will be shown.

However, if you want to provide the View Application Pages rights while also removing the Site Contents menu item, you must alter the Left navigation setting to do so. Alternatively, you can try using the CSS code below.

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>

#Read more: SharePoint Online: Hide Site Contents

1
  • I think this did it! I think the other thing that isn't covered in other documentation/guides is applying the script to the master page. I'll add that here in case anyone else might need it. I had to open the site in SharePoint designer, then connect to the site. Went to the "Master Page" tab, then opened the "seattle.master" to edit. At the end of the <head> tag, I added the css you posted. I saved my changes to the file, but the important part was selecting "seattle.master" after the change and then selecting "Set as custom" from the Ribbon. I hope this helps anyone else too! Commented Jan 17, 2023 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.