WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
$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?

share|improve this question

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

Try 'field' => 'term_id' instead.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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