Removing This Site scope from search dropdown



Problem
Many SharePoint portals require you to remove or hide the default search scope drop down list. Particularly This Site scope etc..

Solution

If need remove this particular site in form, you can use SharePoint designer to edit master page and add following code in java script.

$(document).ready(function(){
$(window).error(function(){
alert("Error");
});

$("select[id$='SBScopesDDL'] option:contains('Scope2')").remove();
$("select[id$='SBScopesDDL'] option:contains('This Site:')").remove();
});

Replace your search dropdown id in ‘SBScopesDDL’ and save, just refresh the page its works fine.

Comments

Popular posts from this blog

PAGE NOT FOUND ERROR PAGE IN SHAREPOINT 2013

Send Mails in SharePoint Event Receiver

Get Host site list items in SharePoint Hosted App.