1

We are using SP2013 on-premise standard edition. By some reason, one of site collection (https://sharepoint.com/sites/notsearch/) required all the content should not be searched out.

Currently we have one Content Source only that we crawl everything under the web application (https://sharepoint.com/). I have two questions:

  1. Is setup a crawl rule to "Exclude all items in this path" https://sharepoint.com/sites/notsearch/ the best and only way to achieve?
  2. I want to remove/hide every "search box" on this site collection. How can I do so? Since user have ability to add a list and enable the search box, can I forbid him?
1

This question makes me say "Hmmm...?" If I have access to the content (Permissions) then why can't I search for the content? The best way to keep it out of an individuals Search Results is to use Security. Though the content is still crawled.

You can prevent the content from being crawled by disallowing the indexing of the site Site Settings | Search and Offline Availability.

1

Alternatively, you can edit your default result source like below

{searchTerms} -Path:{Site.http://domain/sites/dontcrawlthis/}

The above would exclude everything beneath the site collection "dontcrawlthis" including the site collection itself.

If you want to exclude a sub site, you can do below

{searchTerms} -Path:{Site.http://domain/sites/dontcrawlthis/subsite1/}

This solution is a workaround when you do not want to change the "searchable" settings in the site level as suggested by @Matthew McDermott

  • Just saw the final requirement of removing the search box, Best way is to remove it in the Master page. – Anand Sep 26 '18 at 17:34
0

Yes, simply add an exclusion rule for the sub-site collection which you don't want searched.

In regards to hiding the default search box, you will probably want to modify one of the site collection's CSS files to include the following line:

.ms-srch-sb {display:none;}

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.