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();
});
We have been wondering this too. Thanks Jussi & Jasper!
Wow. So frustrating. Adding a feature that no one wants and can’t be disabled. Go MS!
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>
http://social.msdn.microsoft.com/Forums/en-US/sharepointgeneral/thread/ea3cd462-e861-4850-bfb3-f259ec8772ed
Thanks for sharing Jasper and Jussi!
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/
Awesome Tom! I immediately Tweeted it 🙂
Thanks for another very helpful post Jasper.
Have you seen any issues stemming from this when used practically?
-Asif
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 ?
There isn’t an ootb option to remove this feature.
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';
}
}
}
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.
That’s such a great idea! Thanks for sharing Matthew 🙂
what a simple solution! Thanks!.