Title: Problem filtering posts and post count
Last modified: August 20, 2016

---

# Problem filtering posts and post count

 *  [rubentrf](https://wordpress.org/support/users/rubentrf/)
 * (@rubentrf)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/problem-filtering-posts-and-post-count/)
 * I’ve some filters on the_posts, so the users can view only certain posts based
   on some user metas and some complicated conditions.
 * Anyway, when WordPress query for posts, for example on the home page or the search
   page, it seems like the posts are 1st fetched, truncated to 10 (for example) 
   results, and then, filtered, so, if there’s no post allowed on these 10, no post
   is shown.
 * The desired behavior is, obviously, remove ALL the disallowed posts first and
   then select 10 results.
 * A filter on the_posts does the first case, what will be the workflow for the 
   second?
 * Thanks for all

The topic ‘Problem filtering posts and post count’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [rubentrf](https://wordpress.org/support/users/rubentrf/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/problem-filtering-posts-and-post-count/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
