Title: Exclude posts from query
Last modified: August 19, 2016

---

# Exclude posts from query

 *  [ReinoNL](https://wordpress.org/support/users/reinonl/)
 * (@reinonl)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/exclude-posts-from-query/)
 * Is there a way the exclude posts (by id) from the query?
    Like:
 *     ```
       <?php
                       query_posts(array(
       				'p' => '-1307',
                       ));
                   ?>
       ```
   
 * Thanks!

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/exclude-posts-from-query/#post-1299160)
 *     ```
       <?php  $args = array (
       	'post__not_in' => array(1307)
       );
       query_posts($args); ?>
       ```
   
 * [http://codex.wordpress.org/Template_Tags/query_posts#Post_.26_Page_Parameters](http://codex.wordpress.org/Template_Tags/query_posts#Post_.26_Page_Parameters)
 *  Thread Starter [ReinoNL](https://wordpress.org/support/users/reinonl/)
 * (@reinonl)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/exclude-posts-from-query/#post-1299276)
 * Thanks esmi!
    I should have figured this out myself, seen it before, think my
   brain got stuck 🙂

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

The topic ‘Exclude posts from query’ is closed to new replies.

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [ReinoNL](https://wordpress.org/support/users/reinonl/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/exclude-posts-from-query/#post-1299276)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
