Vishmax.com
Read

How to exclude category from WordPress search results

We design and develop websites, digital experiences, and software solutions for growing businesses.

Sometimes you do not like to display post in specified category on WordPress search results, below is a code for excluding a category from WordPress search. this will work fine within the loop.

 
<?php
          query_posts("s=$s&cat=-90,-100&posts_per_page=-1");
?>