Friday 21 October 2016

Sharepoint 2013 - Remove "Recent" from left menu

Problem : 
My client has requested that she be able to remove (or hide) the "Recent" menu header from the left menu in Sharepoint 2013. This is for specified site collections/sites/pages, not farm-wide.

So far, I've tried to do this via JQuery by adding the following code

script type="text/javascript">
jQuery(document).ready(function() {
 jQuery(".ms-core-listMenu-item:contains('Recent')").parent().hide();
});
/script>

via both a script web-part and via a content editor web-part (using embed code), but to no avail. I've also tried adding the code above to a .js file (without the script tags) and calling it as



instead, but it still doesn't work.

I've checked the page source and I can see the script is included. The "Recent" menu item however, is still there. My prefered solution would be to hide the menu item rather than remove it - I suspect removing it will probably cause issues as Sharepoint likely expects it to be there.

There's no requirement to use JQuery - it just seemed to me to be the best way. I would also rather not edit master pages unless there's no other choice.

Any ideas?

Solution: 
If its specific site collection why don't go to site settings >> navigation settings and remove the "Recent" heading and its links.
Am I missing something?



script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript">/script>

script type="text/javascript"
jQuery(document).ready(function() {
  jQuery(".ms-core-listMenu-item:contains('Recent')").parent().hide();
});
/script>