$query_args = array(
        'cat' => $lesson_id,
        'meta_value' => $lesson_type,
        'post__not_in' => array($current_post_id),
        'tax_query' => array(
                'taxonomy' => 'series',
                'field' => 'id',
                'terms' => $series_id,
                'operator' => 'NOT IN'


I'm trying to exclude posts tagged with a series id in the series custom taxonomy, but it's not working. What's wrong with the code?

1 Answer 1


The 'field' => 'id' is not valid.

Try 'field' => 'term_id' instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.