Hide Contextual Search Scope from Search Dropdown

Requirement: Hide the contextual “This Site: Site Name” search scope from Search drop down.

Solution:

1. Copy the folder OSearchEnhancedFeature from “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\OSearchEnhancedFeature” as “OSearchNoContextScope”

2. Delete the SearchAdminLinks.xml file inside OSearchNoContextScope and remove the reference <ElementManifest Location=”searchadminlinks.xml”/>  from Feature.xml

3. Edit the Feature.xml file, Change the Feature GUID, Feature Title, description.

4. Add <Property Name=”DropDownMode”>ShowDD_NoContextual</Property> in SearchArea.xml. Move the <Property Name=”UseSiteDefaults”>true</Property> next to it.
searchscope modifications
4. Build and Create a WSP. Deploy & activate the feature “Hide Contextual Search Scope Dropdown items” to see it in action!
add feature

Project structure
 ProjectStructure
Before:
before
After:
after

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply