Title: get_posts (exclude sticky posts)
Last modified: August 20, 2016

---

# get_posts (exclude sticky posts)

 *  Resolved [Gloria](https://wordpress.org/support/users/erfo/)
 * (@erfo)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/get_posts-exclude-highlighted-post/)
 * Hi!
 * I’ve a script:
    `get_posts('numberposts=1');` I would like to exclude the sticky
   posts. How?
 * Thanks.

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/get_posts-exclude-highlighted-post/#post-2394958)
 * Try:
 *     ```
       get_posts( array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => 1 ) );
       ```
   
 * [http://codex.wordpress.org/Function_Reference/WP_Query#Sticky_Post_Parameters](http://codex.wordpress.org/Function_Reference/WP_Query#Sticky_Post_Parameters)
 *  Thread Starter [Gloria](https://wordpress.org/support/users/erfo/)
 * (@erfo)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/get_posts-exclude-highlighted-post/#post-2394961)
 * Thanks.
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/get_posts-exclude-highlighted-post/#post-2394965)
 * You’re welcome. Glad you got it resolved.

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

The topic ‘get_posts (exclude sticky posts)’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/get_posts-exclude-highlighted-post/#post-2394965)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
