• Hi, how can I do fetch posts for which a custom meta key is NOT set ? (like in ticket : https://core.trac.www.ads-software.com/ticket/18158) ?

    I did try with the parameter

    'meta_query' => array(
    				array(
    					'key' => $this->meta_key,
    					'meta_compare'=>'!=',
    					'meta_value'=>'true'
    				)
    			)

    But it’s not workind, and also with the ‘posts_where’ filter

    $where .= " AND {$wpdb->postmeta}.meta_key!='{$this->meta_key}'";

    not working either.. Thanks !

  • The topic ‘Meta Query for posts with a meta key not set’ is closed to new replies.