Title: Problem with Query_posts and filtering
Last modified: August 19, 2016

---

# Problem with Query_posts and filtering

 *  [docarzt](https://wordpress.org/support/users/docarzt/)
 * (@docarzt)
 * [17 years ago](https://wordpress.org/support/topic/problem-with-query_posts-and-filtering/)
 * I’m trying to exclude some categories and tags from my front page. I used this
   code to accomplish it:
 * <?php
    $args= array( ‘category__not_in’ => array(443, 947, 701), ‘showposts’=
   >8, ‘tag__not_in’ => array(’21’), ); query_posts($args); while (have_posts()):
   the_post(); ?>
 * However, when I surf to an older page (ie [http://www.tvovermind.com/page/6](http://www.tvovermind.com/page/6))
   I’m getting the same entries on each page. Where am I going wrong?

Viewing 1 replies (of 1 total)

 *  Thread Starter [docarzt](https://wordpress.org/support/users/docarzt/)
 * (@docarzt)
 * [17 years ago](https://wordpress.org/support/topic/problem-with-query_posts-and-filtering/#post-1081142)
 * Okay well I saved this by checking in the head with is_paged() and setting a 
   flag. Later, I check the flag :
 * if ($paged == 1) { query_posts($query_string . ‘&showposts=8’); }
 * and it seems to work. Is there a cleaner way?

Viewing 1 replies (of 1 total)

The topic ‘Problem with Query_posts and filtering’ is closed to new replies.

## Tags

 * [query_post](https://wordpress.org/support/topic-tag/query_post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [docarzt](https://wordpress.org/support/users/docarzt/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/problem-with-query_posts-and-filtering/#post-1081142)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
