• Hi Dave,

    I’ve added this code

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

    To exclude pages from post results and on the results page it works fine.
    But the results of the live search still include pages in it. Is there a way to avoid this behaviour?

    Thanks
    Best regards
    Carlo

    https://www.ads-software.com/plugins/daves-wordpress-live-search/

  • The topic ‘How to exclude pages from search results?’ is closed to new replies.