Title: Exclude category from array
Last modified: August 20, 2016

---

# Exclude category from array

 *  Resolved [canutedechou](https://wordpress.org/support/users/canutedechou/)
 * (@canutedechou)
 * [15 years ago](https://wordpress.org/support/topic/exclude-category-from-array/)
 * i ussually have no problems wit excludng categories with the normal method, but
   i just cant figure out because these query is different from the one i usually
   use
 * i need to exclude a id category from these query
    i have
 * [here is the paste bin](http://pastebin.com/S135BdKG)
 * any idea?

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years ago](https://wordpress.org/support/topic/exclude-category-from-array/#post-2100320)
 *     ```
       $catid = 127; //the cat id to exclude
       $args = array( 'posts_per_page' => 5, 'category__not_in' => array($catid) );
       ```
   
 *  Thread Starter [canutedechou](https://wordpress.org/support/users/canutedechou/)
 * (@canutedechou)
 * [15 years ago](https://wordpress.org/support/topic/exclude-category-from-array/#post-2100322)
 * genious!
    thanks a lot!
 *  Thread Starter [canutedechou](https://wordpress.org/support/users/canutedechou/)
 * (@canutedechou)
 * [15 years ago](https://wordpress.org/support/topic/exclude-category-from-array/#post-2100396)
 * and (got another question)
    how do i exlucde 2 categories?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years ago](https://wordpress.org/support/topic/exclude-category-from-array/#post-2100400)
 * [http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters)
 * example:
    `'category__not_in' => array(127, 233)`

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

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 4 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/exclude-category-from-array/#post-2100400)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
