How to exclude or prevent users from search below keywords all, docs, test etc, if users search using these keywords SharePoint search must not display any results.


2 Answers 2


While I agree with the answer by Morten K in that there are always ways to get around a keyword exclusion, it does not accurately respond to the question.

You can find a way to run query rules that cause exclusion of certain keywords here: Exclude Keywords from Search

  • True - in hindsight it should have been a comment. Out of curiosity can you implement at global query rule or would it need to be set on every single search form in the farm?
    – Morten K
    Sep 21, 2018 at 6:00
  • Honestly, I have never tried either as I do not see the point in excluding this way. I would rather exclude based on permissions. However, I would believe that you should be able to exclude in this manner globally as long as someone is not using custom search boxes that are using their own rules. Sep 21, 2018 at 15:57

What's the reason for this? If it is to prevent the users from getting their hands on files they shouldn't then it's a no go. There's literally several other way to surface the files other than search.

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.