If you want to exclude wordpress pages from the search then you have to add following code in your themes function.php file.

    function SearchFilter($query) {
    if ($query->is_search) {
    $query->set('post_type', 'post');
    }
    return $query;
    }

    add_filter('pre_get_posts','SearchFilter');

Above code filters all the posts retrieved by the wordpress query and set post_type equal to “post”.

Source

WordPress Filters
bavotasan