This is something I do in almost every theme I create, yet whenever I come to do it I can never remember how. I’m hoping that writing it down will help me remember.
To get all posts, except those with certain tags, you have to use the function ‘tag__not_in()‘. It takes an array of tag IDs as an argument, and hey presto! Example code below:
//get all news except those tagged with 'feature' (ID=14) or 'also' (ID=16)
$args=array(
'showposts'=> 6,
'tag__not_in'=> array(14, 16),
);
$recent = new WP_Query($args); while($recent->have_posts()) : $recent->the_post();?>