Select posts wich has no relationship in custom taxonomy
I have found an answer by myself, for those landing here by google: $taxq = array( array( ‘taxonomy’ => ‘story_lng’, ‘field’ => ‘id’, ‘operator’ => ‘NOT EXISTS’, ) ); That results in AND (NOT EXISTS( SELECT 1 FROM wp_term_relationships INNER JOIN wp_term_taxonomy ON wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id WHERE wp_term_taxonomy.taxonomy = ‘story_lng’ AND wp_term_relationships.object_id = wp_posts.ID)) AND … Read more