A situation that comes up often is wanting to hide certain pages from WordPress search results. This can be achieved pretty easily using the pre_get_posts
hook in your functions.php file. Just pass in an array of page IDs to the 'post__not_in'
WP_Query parameter (note the double underscores) and you’re good to go.