Does anyone know how to exclude all tagged posts from WP_Query loop?

I can do it with 'tag__not_in' for specific tag IDs – see below:

<?php $loop = new WP_Query( array( 'post_type' => 'poetry', 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'ASC', 'tag__not_in' => array(8, 9) ) ); ?>

But I was wanting to eliminate all tagged posts without updating the tag IDs in the 'tag__not_in'.



1 Answer 1


Use the tax_query parameter with the taxonomy set as post_tag. See the following previous answer:

Get all posts without tags

  • No problem, could you mark the question as answered?
    – Svartbaard
    Commented Mar 24, 2017 at 13:44

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.