For one of our customers we wanted to remove the search “this site” option from the dropdown. The site consists only of some rollup information and a single page, so searching it for content makes no sense. The search this site option also ignores the search center url specified in the configuration, another reason to remove it.
As described in this post at TechNet you can disable the option by editing the OSearchEnhancedFeature, but this would affect all sites, and editing standard features is not a clean option as it might be overwritten with service packs.
I decided to remove the dropdown value with the help of some javascript. Just insert a Content Editor Web Part and insert the following javascript code:
var searchDropDown =
document.all.ctl00$PlaceHolderSearchArea$ctl01$SBScopesDDL;
var removeID = 100;
for (var x = 0; x <= searchDropDown.options.length-1; x++) { if (searchDropDown.options[x].value=="This Site") { removeID = x; } } if (removeID<100) { searchDropDown.remove(removeID); } </script>
This code will remove the option from the dropdown and it’s tested in IE and Firefox.
You can also download this preconfigured Web Part and add it to the required page. Enjoy!
July 30, 2009 at 11:18 am
Using the CEWP you would need to repeat this on every page in the site.
You can also use the Free SharePoint Infuser tool to automatically inject script in every page.
See http://www.muhimbi.com/blog/2009/07/massage-sharepoint-into-submission.html