Exclude pages from WordPress search

To exclude page from search, add following code to your theme’s functions.php.

Exclude page and all it’s child pages from search.