Hiding the SharePoint Search Scope Dropdown List

By:   |   Comments   |   Related: > SharePoint Configuration


Problem

Many SharePoint portals require you to remove or hide the default search scope drop down list.  In this tip we cover the steps you can take to do this.

Solution

We have many alternatives to fix this issue:

Entire Farm

If you want to remove or hide the search scope drop down list for the entire farm (i.e.: For any Site - Not recommended) go to the below path:

	C:\Program Files\Common Files\microsoft shared\Web server extensions\12\Template\features\OSearchEnhancedFeature\SearchArea.xml

Then open the "SearchArea.xml" file and add the following tag element to hide the drop down list:

<Property Name = "DropDownMode"> Hide Scope DD</Property> 

Then go to the below path:

C:\Program Files\Common Files\microsoft shared\Web server extensions\12\Template\features\OSearchBasicFeature\SearchArea.xml

Then open "SearchArea.xml" file and search for the below tag:

<Property Name="DropDownMode">ShowDD</Property>

And replace "ShowDD" with "Hide Scope DD".  After this do an iisreset (IIS recycle pool) so this will take effect.

Specific Site

If you want to remove or hide the search scope drop down list for a certain site (Recommended - There are Several Alternatives).

=> You can use SharePoint Designer / CEWP (Content Editor Web part) to add the below CSS Style:

<style>
select .ms-searchbox
{
display : none ;
</style>

Or

=> You can use SharePoint Designer to add the below JQuery:

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

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

Or

=> You can use SharePoint Designer / CEWP to add the below Java Script, where "ctl00_g_edb49d82_8042_45e7_b0f7_2fa3fbed4ae6_SBScopesDDL" is the Client rendered ID for the search scope drop down list. You can get this value via IE - Developer tool bar or the Firebug tool.

<script language="javascript" type="text/javascript">
var objDDL = document.getElementById("ctl00_g_edb49d82_8042_45e7_b0f7_2fa3fbed4ae6_SBScopesDDL");
if( objDDL ) {
objDDL.selectedIndex = 0;
objDDL.style.display="none";
}

Or

=> You can use SharePoint Designer to edit the master page and remove the default simple search box control.  Then add another new simple search box web part and right click on it to get the web part properties pane.  Then select "remove search scope " drop down list option item from the search scope section.

Next Steps


sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Hesham Saad Hesham Saad

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips



Comments For This Article

















get free sql tips
agree to terms