0

There is a "Home" link in global navigation of my publishing site which I want to hide. It is not available in "Navigation" in "Site Settings" so I cannot hide it from there.

All the solutions available on internet are about SharePoint 2010/2013 and they are not working for SharePoint 2016. How can I hide that Home link?

EDIT

Here's that element:

<a class="static selected menu-item ms-core-listMenu-item ms-displayInline ms-core-listMenu-selected ms-navedit-linkNode shortpoint-nav-home-link shortpoint-nav-a-selected" accesskey="1" href="/sites/somesite/en/Pages/default.aspx">
    <span class="additional-background ms-navedit-flyoutArrow">
        <span class="menu-item-text" data-original-word="English">Home</span>
        <span class="ms-hidden">Currently selected</span>
    </span>
</a>
8
  • Are you not able to hide the link using custom css and element selector (of home link)? Commented Aug 10, 2020 at 6:33
  • That's what I am trying to do but I am unable to find unique element selector using which I can hide the home link. Commented Aug 10, 2020 at 6:50
  • try something like a[title^='Home'][class^='ms-Nav-link'] Commented Aug 10, 2020 at 6:59
  • I have mentioned element in my original post. Please check. Commented Aug 10, 2020 at 7:02
  • Try using a.menu-item.shortpoint-nav-home-link {display: none !important}. let me know if this works Commented Aug 10, 2020 at 7:13

2 Answers 2

1

I add below style in a Altertive CSS file and it works well here.

a.menu-item.shortpoint-nav-home-link {
    display: none !important
}

div#sideNavBox li.static:first-child{
    display: none !important
}

enter image description here

Below is my page element:

enter image description here

And you may have a try JS code:

<script src="https://code.jquery.com/jquery-3.1.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("div#sideNavBox span:contains('Home')").closest("li").hide();
 
    })
</script>
0

In SharePoint 2016 and 2019, the best working option to remove the site collection title from the top global navigation, without changing the master page, consists in adding to the page this in a script editor web part:

<style type="text/css">
#DeltaTopNavigation ul.ms-core-listMenu-root > li:first-child > a
{
    display: none !important; 
}
</style>

This leave the "Home" in left navigation menu, but remove the site collection title from the top menu.

If you want instead to remove from both (left and top menu) use the following:

<style type="text/css">
ul.ms-core-listMenu-root > li:first-child > a
{
    display: none !important; 
}
</style>

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.