How to Exclude Pages from WordPress Search Results

Add the following code in your functions.php file

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

Related Post

Latest Post

Recent Posts Widget

Make sure to never miss a thing...

Get the latest news from the creative industry along with other creative goodies, conveniently delivered to social media.