In WSS 3.0, there's an option under "Advanced Settings" for a List as follows:


Specify whether this list should be visible in search results. Users who do not have permission to see these items will not see them in search results, no matter what this setting is.

Every option on the advanced settings has an SPList property that corresponds to it (EnableAttachments, WriteSecurity, AllowContentTypes...) except for this property. And this property happens to be the one I want to enable on deployment. The SDK has proven unusually fruitless in trying to figure this out.

Is it possible to enable this "do not show items in this list on search" property programmatically, and if so, how?

2 Answers 2

SPList list = ...    
list.NoCrawl = true;    

See MSDN's SPList.NoCrawl property

  • So simple, and yet so easy to overlook because all of the documentation seems to go all the way to avoiding the word "Search" on a setting that, in the UI, only says "Search".
    – Grace Note
    May 23, 2011 at 17:00

Not sure about Programatically but you can set this in the Site using the Library Settings/Advanced Settings and set the Search "allow items in the document library to appear in search results" to be no.

Do you have that many sites that you can't set this in the Site Collection root?

  • Quite, it's also across multiple site collections and new collections that will be deployed in the future. It's something I'd really like to enable as part of the automated portion of the deployment.
    – Grace Note
    May 19, 2011 at 18:06
  • So if you do not want to have any pages crawled, why not just uninstall the Search Service Instance? Are you trying to assure at the Site level some pages will never get crawled but some may at a future date?
    – MichaelF
    May 19, 2011 at 19:31
  • I want to stop 1 specific list that's deployed on each site. It's a single list that's used purely as a lookup table. The rest of the stuff we do need to be searched, I just don't want all of the lookup table stuff showing up amidst the results (which they do, currently, should I not disable it).
    – Grace Note
    May 19, 2011 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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