Title: How does pre_get_posts work?
Last modified: August 18, 2016

---

# How does pre_get_posts work?

 *  [Bigs](https://wordpress.org/support/users/bigs/)
 * (@bigs)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/how-does-pre_get_posts-work/)
 * Some of my blog entries have the following field.
 * ‘article’ = 1
 * I do not want these to be displayed on my home page and I am hoping the pre_get_posts
   action can stop this.
 * There is an article here
 * [http://codex.wordpress.org/Custom_Queries](http://codex.wordpress.org/Custom_Queries)
 * But i can’t work out what is going on. Can this action be used to solve my problem?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/how-does-pre_get_posts-work/#post-650028)
 * Can’t address your pre_get_posts question, but what is causing that text to display.
 * Is that text in your Post, or is that a Custom Field?
 *  Thread Starter [Bigs](https://wordpress.org/support/users/bigs/)
 * (@bigs)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/how-does-pre_get_posts-work/#post-650031)
 * Sorry, the article = 1 isn’t being displayed.
 * The question was whether I could modify a query some how to identify this optional
   field and remove it.
 * After some Googling I have managed to remove a category from my blog roll. It
   wasn’t exactly what I was after but it has done the trick.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/how-does-pre_get_posts-work/#post-650093)
 * I put up a plugin here that lets you limit posts on the home page based on custom
   field data:
 * [http://wordpress.org/support/topic/93438](http://wordpress.org/support/topic/93438)
 * It [should] be trivial to update it so it offers an option to *not* display certain
   posts based on a custom field. That is, if you’re interested…

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How does pre_get_posts work?’ is closed to new replies.

## Tags

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

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 3 replies
 * 3 participants
 * Last reply from: [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * Last activity: [18 years, 7 months ago](https://wordpress.org/support/topic/how-does-pre_get_posts-work/#post-650093)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
