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


It wont exclude the category that i want. Posts still show up

share|improve this question

As far as I remember category__not_in takes array of IDs, which are pain to use when written as string.

For single category it would is easier to write it as cat=-14 (minus before ID).

See Category Parameters in Codex.

PS I think you meant query_posts(), not query()?..

share|improve this answer
Cool, thanks for the help! – estern Dec 1 '10 at 21:57


global $wp_query;           
$wp_query->set('cat', '-14,-1172,-867');
$posts = $wp_query->get_posts();
share|improve this answer

Your Answer


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