Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How do i exclude top navigation in sharepoint 2010 site from being seen by SharePoint search. I have tried adding noindex class to the control as below but it doesn't work.

<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
                <asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
                    <SharePoint:AspMenu
                      ID="TopNavigationMenuV4"
                      Runat="server"
                      EnableViewState="false"
                      DataSourceID="topSiteMap"
                      AccessKey="<%$Resources:wss,navigation_accesskey%>"
                      UseSimpleRendering="true"
                      UseSeparateCss="false"
                      Orientation="Horizontal"
                      StaticDisplayLevels="2"
                      MaximumDynamicDisplayLevels="1"
                      SkipLinkText=""
                      CssClass="s4-tn noindex"/>
                    <SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
                        <Template_Controls>
                            <asp:SiteMapDataSource
                              ShowStartingNode="False"
                              SiteMapProvider="SPNavigationProvider"
                              id="topSiteMap"
                              runat="server"
                              StartingNodeUrl="sid:1002"/>
                        </Template_Controls>
                    </SharePoint:DelegateControl>

                </asp:ContentPlaceHolder>
            </asp:ContentPlaceHolder>

the control adds another nested div with class 'menu-horizontal' to which also i add the 'noindex' class but still Search brings up all the pages if I search for like "About us" as "About us" is in the top nav.

Doesn anyone know how to hide the top nav from SharePoint search?

share|improve this question
    
Looks like you are doing it right. Have you reset the search index after making the change? If not then I suggest you to reset the search index or simply delete and then recreate the content source and run a full crawl. –  Vassili Altynikov Jan 23 '13 at 19:18
1  
check out the below link . . . dotnetmafia.com/blogs/dotnettipoftheday/archive/2011/01/26/… –  user15661 Mar 18 '13 at 4:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.