Title: Exclude current post from post list
Last modified: May 15, 2023

---

# Exclude current post from post list

 *  Resolved [FabioG](https://wordpress.org/support/users/lando39/)
 * (@lando39)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-current-post-from-post-list-2/)
 * Hi,
 * In a single custom post I’m trying to include a section which shows ‘Other posts’.
   I’m doing this via a shortcode and in the where clause of the shortcode I would
   like to exclude the current post so that the ‘other posts’ section doesn’t show
   the current post I’m visiting. I’m doing this via the following short code:
   `**[
   pods name="recipe" limit="3" where="ID NOT in ('{@ID}')" orderby="RAND()" template
   ="Recipe List"]**`
 * My issue is that this where clause simply doesn’t work and none of the posts 
   show when I do this. Can someone suggest what I’m doing wrong here and what should
   be the correct where clause to allow me to display all posts except for the current
   one, please?
   Regards

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

 *  [zubiwat](https://wordpress.org/support/users/zubiwat/)
 * (@zubiwat)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-current-post-from-post-list-2/#post-16739180)
 * Hi,
   Try**where=”t.ID NOT in (‘{@posts.ID}’)”**
 *  Thread Starter [FabioG](https://wordpress.org/support/users/lando39/)
 * (@lando39)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-current-post-from-post-list-2/#post-16741115)
 * Hi,
   I tried this but unfortunately I still cannot get the pods to be displayed.
   Are there any other alternative solutions for this?Thanks and regards.
 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/exclude-current-post-from-post-list-2/#post-16745343)
 * Hi [@lando39](https://wordpress.org/support/users/lando39/)
 * The suggestion from [@zubiwat](https://wordpress.org/support/users/zubiwat/) 
   is already an improvement (`t.` prefix).
 * Why are you using a `NOT IN` statement for a single ID?
   And have you enabled 
   support for special magic tags in shortcode parameters?See !important notice 
   at [https://docs.pods.io/displaying-pods/magic-tags/special-magic-tags/](https://docs.pods.io/displaying-pods/magic-tags/special-magic-tags/)
 * Cheers, Jory
 *  Plugin Author [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * (@keraweb)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/exclude-current-post-from-post-list-2/#post-17006500)
 * Hi [@lando39](https://wordpress.org/support/users/lando39/)
 * We havent heard from you anymore so I’m closing this topic.
   Feel free to reopen
   if you still need help!
 * Cheers, Jory

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

The topic ‘Exclude current post from post list’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Jory Hogeveen](https://wordpress.org/support/users/keraweb/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/exclude-current-post-from-post-list-2/#post-17006500)
 * Status: resolved