Title: Exclude Current Post
Last modified: November 22, 2017

---

# Exclude Current Post

 *  [edzie](https://wordpress.org/support/users/edzie/)
 * (@edzie)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/exclude-current-post-10/)
 * I not see any front-end option to exclude the current post from the Widget like
   many other similar plugins have.
 * Surprisingly –I am bot a coder– it seems that I managed to do it with this function.
   php filter:
 * add_filter(‘upw_wp_query_args’, ‘upw_only_posts_with_thumbnails’,10 , 2);
    function
   upw_only_posts_with_thumbnails($args, $instance) { if( is_singular() && !isset(
   $args[‘post__in’] ) ) $args[‘post__not_in’] = array( get_the_ID() ); return $
   args; }
 * I use the custom template option.
 * Still, I think there should be an easier way to get it.

The topic ‘Exclude Current Post’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ultimate-posts-widget_5b9f2b.svg)
 * [Ultimate Posts Widget](https://wordpress.org/plugins/ultimate-posts-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-posts-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-posts-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-posts-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-posts-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-posts-widget/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [edzie](https://wordpress.org/support/users/edzie/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/exclude-current-post-10/)
 * Status: not resolved