SharePoint provides the ability to control search indexing (a.k.a. “crawling”) within a page by using a div class named “noindex”.  This means you can flag some content on a page that should not be indexed for search results, while other content on the page is still indexed.  The typical scenario that requires this is common footer text.  Suppose you edit your master page to contain some standard text, including your company name and a link to your privacy policy.  Now, search results for your company or privacy policy will include every page in the site because this text is there.  What you really want is just pages that contain unique content about those keywords.

SharePoint 2010’s iFilter excludes content inside of a <div class="noindex"> 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.

<div class="companyFooterStyle noindex">
      Copyright 2010 © Company Name | <a href="/sitepages/PrivacyPolicy.aspx">Privacy Policy</a>
</div>

Now, when you search the portal for “Company Name” or “Privacy” you won’t get every page in the portal showing up in your results.

Note the ability to use other css classes along with noindex, to get visual styles as well.  I haven’t tested the noindex class on tags other than div.

 

Technorati Tags: ,,