Exclude a category from WP_Query

Issue 1

In your tax query, you should use NOT IN instead of NOT_IN. That’s preventing your tax query from working ( Assuming that the other fields are correct ).

Issue 2

In your arguments for WP_Query(), you should use category__not_in instead of cat. So, change your code to:

$argsQuery = array(
    'posts_per_page'   => 3,
    'post_type'        => 'download',
    'category__not_in' => 5 ,
);

Leave a Comment

tech