Wordpress Search Function to only search posts
Answer is here
http://www.shilling.id.au/2011/06/23/wordpress-search-only-show-post-and-not-pages/
<?php
function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','SearchFilter');
?>
Simply add <input type="hidden" name="post_type" value="post" />
to the theme search form... regards!