As the title suggests I'm trying to prevent people from finding items from a list in a particular site collection while still allowing the internal search of that site collection to work.

My Googling has only turned up answers to compeltely prevent a site or list from appearing in any searches ie. by either going into Search and Offline Availability and selecting No under "Allow this site to appear in search results" or No under "Allow items from this list to appear in search results".

As both of these options prevent users from searching items from a list while in the list itself it doesn't suit my purposes.

I've tried putting -path:https://xxx.sharepoint.com/sites/PI/ATE into the query builder and although this does stop the site from appearing it means that when there is nothing in the search box the results box is full of random items.

Is there another way to either modify the search box or search results box to exclude particular site collections? is -path:https://xxx.sharepoint.com/sites/PI/ATE the best I can do?

1 Answer 1


Since we cannot modify crawl rules in SharePoint Online, I would say yes, it is the best you can do.

And it is the default behavior of search result web part to automatically return all search results matching the search queries.

In addition, the modern search page of SharePoint Online doesn’t support customization currently.

Even if you modify the search box web part and search result web part, you can’t really prevent the site collection from appearing in the global search results, unless due to security reasons.

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.