We have a complicated database query and we would like to exclude some posts. We've tried to do it with SQL, but it's really complicated. The simplest solution seems to loop through the results after the query's made and then exclude a few posts. The problem is, i don't know where to do it! I've tried to unset posts in $wp_query->posts, but they still show up. Is there a proper way to do this? Is there another array WordPress uses that I should unset from?
Do you know the ID of the posts? Have you passed post__not_in as part of your query?
From: http://codex.wordpress.org/Class_Reference/WP_Query. The above will return all posts but exclude the IDs specified.
Or do you have another way to group the posts you do not want i.e. by a category or author? A bit of context might help :)