How to Exclude a Post Category from WordPress Search

How to exclude a post categories form WordPress search results.

Put the code below in your themes functions.php file.

Code: