Hide “Recent” from SharePoint 2013 Quick Launch Navigation
The recent section gets added automatically through a Web Control on SharePoint pages. ‘Recent’ menu is individual to each user! Meaning everyone gets their own recent section with links to their recent activities! If you have a requirement to remove (or hide) the “Recent” menu header from the left navigation of SharePoint 2013, Here are some solutions:
In Publishing sites, You can remove the “Recent” section manually by going to Site Settings >> Look and Feel >> Navigation (or Quick launch on Non-publishing sites!).
How to hide recent in SharePoint 2013 using jQuery?
Edit the page, Add a script editor web part, and place this code in it (or master page HTML)
<script src="https://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>
Hide “Recent” heading in SharePoint 2013 Quick launch with PowerShell:
You can also remove the “Recent” section using PowerShell by deleting the recent header.
PowerShell script to delete recent group in SharePoint 2013 left navigation:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$web = Get-SPWeb "https://your-sharepoint-site-url"
#Process Quick launch
for ($i = $web.Navigation.QuickLaunch.Count-1; $i -ge 0; $i--)
{
$node = $web.Navigation.QuickLaunch[$i];
if($node.Title -eq "Recent")
{
$node.Delete();
Write-host "Recent section removed from $($web.Title)"
}
}
You can also remove the “Recent” section using Javascript by deleting the recent header.
->
var all = document.querySelectorAll(“.ms-core-listMenu-item”) ;for(var i = 0; i -1){ all[i].parentNode.style.display = ‘none’;}}
How do you display “Recent” on left navigation if you deleted? Create new header in navigation?
Anyone?
I used audience targeting to hide the Recent node. I created PowerShell script to create the nodes in all sub-sites if it did not already exist and applied audience targeting. This seemed to work fine but then when I added a new document library to the site, SharePoint automatically added another Recent node besides the audience targeted Recent node. Any ideas?
Thank you
PS > JS 🙂
Finally! Instructions for using jQuery that were simple to follow and actually work. Thank you!