One of the elements you don’t have control over in a Sharepoint 2010 environment is the label for the contextual search option in the search drop down list (“This Site: “ and the name of the current site):
The dynamic nature of the contextual search definition means that wherever you are in your Sharepoint solution where the search drop down list is visible you will have a “This Site: “ option.
In some cases you might want to change this text. One annoying situation is if your solution has a series of sites that share a common prefix, and this prefix is just long enough to take up all the visible real estate of the drop down box. Your users will then see “This Site: Long Site Prefix” for all sites, instead of the last part of the name which is actually unique.
This script will search for the drop down list (identified by ‘ctl00_PlaceHolderSearchArea_ctl01_SBScopesDDL’) and replace the first value with “My custom label”.
Save the webpart and the search drop down list should now display your own value. If not, use something like the developer tools in IE and search for the correct id for the element (not name!). The easiest way is to search for whatever value currently displayed for contextual search (“This Site: Prototyping” in my case”) and then get the ID of the placeholder:
And there you go: