Paste the following in functions.php:

//Exclude pages from WordPress Search
if (!is_admin()) {
function wpb_search_filter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','wpb_search_filter');
}

Source: http://www.wpbeginner.com/wp-tutorials/how-to-exclude-pages-from-wordpress-search-results/