1

I have a SharePoint publishing site with a site navigation common to all the pages.

When I crawl the pages, the SP Search indexes even the navigation content. So, if I search a word that is in the navigation section, the search returns all the pages containing that navigation.

How can I index all the page excluding the common navigation?

0

There are two ways, to exclude it from SharePoint 2010 Search.

  1. SharePoint 2010’s iFilter excludes content inside of a tag. Note that each div nested in that one is re-evaluated for the noindex class, so nested divs may not work as you expect. The product team is considering changing this so that all nested divs are excluded.

Read More here about the examples.

How to: Exclude part of a page from being indexed by SharePoint Search

Sharepoint 2010 exclude navigation from search

  1. Another way to make a change to registry along with a piece of code.

    public class NavigationControlBase : UserControl

    {
        /// <summary>
        /// Sends server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter"/> object, which writes the content to be rendered on the client.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> object that receives the server control content.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            // Fix to remove the header text from search engines results
            var myBrowserCaps = Request.Browser;
            if (!myBrowserCaps.Crawler)
            {
                base.Render(writer);
            }
        }
    }
    

then edit the registry followed by IISreset.

Sharepoint 2010 exclude navigation from search

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.