Support » Plugin: Search Everything » Exclude pages with meta

  • Hi! I was wondering if it is possible to exclude pages from search results if they have specific meta data..?

    This works with wp_list_pages:

    	'post_type' => 'page',
    	'meta_key' => 'hide_page',
    	'meta_compare' => '=',
    	'meta_value' => 'Yes'
    $pages = get_posts($exclude_args);
    if ($pages) {
    	$pageids = array();
    	foreach ($pages as $page) {
    		$pageids[]= $page->ID;
    	$args['exclude'] = implode(",", $pageids);

    Thanks in advance!

  • The topic ‘Exclude pages with meta’ is closed to new replies.