SharePoint

SharePoint 2013 – Remove recent in the quick launch

SharePoint 2013 contains a new feature that creates a Recent shortcut in the quick launch. This shortcut appears after creating a new app. One of our customers doesn’t want to use this feature. There is only NO out-of-the-box feature to remove it. Very strange. I asked on SPYAM how to remove the shortcut. I received the following answer from Jussi Roine:

The Recent-section gets added automatically through a WebControl on the page. To automatically remove the who section (including child navigation nodes of Recent) you could enable a custom feature, that simply does a .Delete() against the corresponding navigation node in SPWeb.Navigation.QuickLaunch navigation collection. 

Then just call your custom feature from your provisioning logic, and way Recent -section would always be removed upon provisioning a new site. 
Alternatively you could use some CSS-styling but that wouldn’t really remove it, but just hide.


Hopefully this can set you in the right direction. Thanks Jussi!

Edit


Thanks to my visitors for leaving valuable replies! Another solution is:

jQuery(document).ready(function() {
jQuery
(".ms-core-listMenu-item:contains('Recent')").parent().hide();
});

You Might Also Like

14 Comments

  • Reply
    Anonymous
    February 6, 2013 at 8:19 am

    We have been wondering this too. Thanks Jussi & Jasper!

  • Reply
    Anonymous
    March 26, 2013 at 11:49 pm

    Wow. So frustrating. Adding a feature that no one wants and can’t be disabled. Go MS!

  • Reply
    Anonymous
    May 24, 2013 at 4:33 pm

    What I did:
    Added a jQuery reference to my master page and added the following script to the end of these closing tags. If you use $(document).ready, you see the updating of the page.

    This script gets rid of it as it is created. SharePoint:SPTreeView SharePoint:SPRememberScroll Template_Controls
    SharePoint:DelegateControl
    SharePoint:SPNavigationManager
    script type=”text/javascript”>
    var parent = $(“span.additional-background:contains(‘Recent’)”).parent();
    var parentul = parent.parents(“ul”);
    var childli = $(parentul).find(“ul”);
    parent.replaceWith(childli.html());
    childli.remove();
    parent.hide();
    script>

  • Reply
    Michel Verwijmeren
    May 30, 2013 at 12:10 pm

    Thanks for sharing Jasper and Jussi!

  • Reply
    tommdaly
    January 9, 2014 at 2:53 am

    Thanks for sharing! I like the idea here and I’ve created a sandbox solution which remove the “Recent” node via JavaScript Client Object model asynchronously. This is good for both online and on-prem.
    http://tommdaly.wordpress.com/2014/01/08/permanently-removing-the-recent-node-from-quick-launch-for-sharepoint-2013/

  • Reply
    Jasper Oosterveld
    January 9, 2014 at 11:30 am

    Awesome Tom! I immediately Tweeted it 🙂

  • Reply
    Asif Rehmani
    March 21, 2014 at 8:32 pm

    Thanks for another very helpful post Jasper.

    Have you seen any issues stemming from this when used practically?

    -Asif

  • Reply
    Pankaj Srivastava
    June 5, 2014 at 8:37 am

    Thanks for sharing Jasper ,

    I would like to know why ‘Recent’ Links are coming by default is there any OOTB feature to enable and disable recent links ?

    • Reply
      Jasper Oosterveld
      June 5, 2014 at 8:58 am

      There isn’t an ootb option to remove this feature.

  • Reply
    Dennis Gaida
    August 27, 2014 at 9:52 am

    And in vanilla JavaScript if you don’t need/want jQuery (doesn’t work in IE<9):

    if (document.getElementsByClassName != "undefined") {
    var qlItems = document.getElementById("DeltaPlaceHolderLeftNavBar").getElementsByClassName("ms-core-listMenu-item");
    for (i = 0; i < qlItems.length; i++) {
    if (qlItems[i].innerHTML.indexOf("Zuletzt verwendet") != -1 || qlItems[i].innerHTML.indexOf("Recent") != -1) {
    qlItems[i].parentElement.style.display = 'none';
    }
    }
    }

  • Reply
    Matthew Carter
    October 7, 2015 at 11:51 am

    There’s a much simpler way, and no code required. Go to “Site Settings”, “Navigation”, then select the “Recent” folder and edit the audience targeting setting and add a SharePoint Group that you want to be able to see the Recent folder (create a Group first if you don’t have one). If there is no-one in the SharePoint group, then no-one will see it anymore.

    • Reply
      Jasper Oosterveld
      October 7, 2015 at 12:05 pm

      That’s such a great idea! Thanks for sharing Matthew 🙂

    • Reply
      Mark Marriott
      July 17, 2017 at 12:09 am

      what a simple solution! Thanks!.

    Leave a Reply