Title: Exclude single post from category
Last modified: August 19, 2016

---

# Exclude single post from category

 *  [hafer](https://wordpress.org/support/users/hafer/)
 * (@hafer)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/exclude-single-post-from-category/)
 * I’m displaying on my frontpage articles from a certain category. I usre this 
   code:
 * `<?php query_posts('cat=1&showposts=5'); ?>`
 * Now I want to exclude an article of this listining? Is there a possibility to
   do this?

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

 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/exclude-single-post-from-category/#post-1901195)
 * See this codex page: [http://codex.wordpress.org/Function_Reference/query_posts](http://codex.wordpress.org/Function_Reference/query_posts)
 * … and it reference to this example:
 *     ```
       query_posts( array( 'post__not_in' => array( 2, 5, 12, 14, 20 ) ) );
       ```
   
 *  Thread Starter [hafer](https://wordpress.org/support/users/hafer/)
 * (@hafer)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/exclude-single-post-from-category/#post-1901250)
 * thank you!
 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/exclude-single-post-from-category/#post-1901306)
 * You’re welcome 🙂

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

The topic ‘Exclude single post from category’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Edward Caissie](https://wordpress.org/support/users/cais/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/exclude-single-post-from-category/#post-1901306)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
