Title: Exclude current post?
Last modified: March 17, 2020

---

# Exclude current post?

 *  [Deon](https://wordpress.org/support/users/deon-b/)
 * (@deon-b)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/exclude-current-post-17/)
 * Hi,
    can I exclude the current post from the list of related posts?
 * So lets say I have an article: “how to wash a cat”
    I insert at the bottom the
   shortcode [display-posts category=”cats”]
 * and its displaying all posts in that category, but also “how to wash a cat” which
   is the current post.
 * Any way to exclude that current post automatically?
 * Also, second question does this work on “pages”?

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

 *  Plugin Author [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/exclude-current-post-17/#post-12566485)
 * You can use the exclude_current parameter for that:
 * [display-posts category=”cats” exclude_current=”true”]
 *  Plugin Author [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/exclude-current-post-17/#post-12566486)
 * And yes, this does work for pages. The default post type is ‘post’, but you can
   query for pages like so:
 * [display-posts post_type=”page”]
 * Here’s a full list of the available parameters: [https://displayposts.com/docs/parameters/](https://displayposts.com/docs/parameters/)
 *  Thread Starter [Deon](https://wordpress.org/support/users/deon-b/)
 * (@deon-b)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/exclude-current-post-17/#post-12566690)
 * Hi,
    I already pasted the shortcode in over 200 posts, how can I set current 
   post excluded by default in functions.php?
 *  Thread Starter [Deon](https://wordpress.org/support/users/deon-b/)
 * (@deon-b)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/exclude-current-post-17/#post-12567030)
 * Hi,
    problem solved, I added this
 *  `’exclude_current’=> “true”,
    ‘orderby’ => ‘rand’,`
 * Thanks

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

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

 * ![](https://ps.w.org/display-posts-shortcode/assets/icon-256x256.jpg?rev=2940963)
 * [Display Posts - Easy lists, grids, navigation, and more](https://wordpress.org/plugins/display-posts-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/display-posts-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/display-posts-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/display-posts-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/display-posts-shortcode/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Deon](https://wordpress.org/support/users/deon-b/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/exclude-current-post-17/#post-12567030)
 * Status: not resolved