Title: get_adjacent_posts exclude category syntax
Last modified: August 20, 2016

---

# get_adjacent_posts exclude category syntax

 *  [toyNN](https://wordpress.org/support/users/toynn/)
 * (@toynn)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/get_adjacent_posts-exclude-category-syntax/)
 * Still a bit new to coding in WordPress but I’m left scratching my head on this…
 * After spending a number of hours tbshooting why only the first category was excluded
   when I called the get_adjacent_posts() like this:
 * `$prevPost = get_adjacent_post(false,'30,31,32,410',true);`
 * I opened up the code’s core library link-template.php and find the delimiter 
   for the exclude category list should be ” and ” so that now this actually works:
 * `$prevPost = get_adjacent_post(false,'30 and 31 and 32 and 410',true);`
 * On the codex pages for get_adjacent_post() and related get_next_post()/get_previous_post()
   functions this delimiter isn’t documented from what I could see.
 * Is the ” and ” delimiter common practice in WordPress for delimiting category
   or tag IDs in functions? Seems like an odd delimiter not to be documented unless
   if I was more experienced I’d know this was common WP practice.
 * Thanks for any feedback on this one.
 * David

Viewing 1 replies (of 1 total)

 *  [PoMa](https://wordpress.org/support/users/pornomagnatas/)
 * (@pornomagnatas)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/get_adjacent_posts-exclude-category-syntax/#post-2385438)
 * Thank God and toyNN… It works. Almost spend an hour searching for solution…
 * I will add here more keywords, so more users will be able to find it:
 * **
    get_adjacent_post exclude multiple
   , exclude multiple categories, syntax

Viewing 1 replies (of 1 total)

The topic ‘get_adjacent_posts exclude category syntax’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [PoMa](https://wordpress.org/support/users/pornomagnatas/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/get_adjacent_posts-exclude-category-syntax/#post-2385438)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
