Title: Exclude self
Last modified: July 23, 2019

---

# Exclude self

 *  Resolved [littlebizonline](https://wordpress.org/support/users/littlebizonline/)
 * (@littlebizonline)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/exclude-self/)
 * Is there a way to exclude the current post from the list of posts?
    E.g. I am
   in Post A, and when I see the list of posts from the same category as “related
   posts”, I don’t really want Post A to be in the list (because I am already reading
   it).
 * Thanks

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

 *  Plugin Author [Tajam](https://wordpress.org/support/users/tajam/)
 * (@tajam)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/exclude-self/#post-11761502)
 * No feature like this yet, but you can use the code below. Copy this code to functions.
   php in your theme/child theme:
 *     ```
       function yourtheme_flex_posts_list_args( $args ) {
       	$post_id = get_the_ID();
       	if ( ! empty( $post_id ) ) {
       		$args['post__not_in'] = array( $post_id );
       	}
       	return $args;
       }
       add_filter( 'flex_posts_list_args', 'yourtheme_flex_posts_list_args' );
       ```
   
 *  Thread Starter [littlebizonline](https://wordpress.org/support/users/littlebizonline/)
 * (@littlebizonline)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/exclude-self/#post-11764735)
 * Awesome – thank you!

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

The topic ‘Exclude self’ is closed to new replies.

 * ![](https://ps.w.org/flex-posts/assets/icon-128x128.png?rev=1871802)
 * [Flex Posts - Widget and Gutenberg Block](https://wordpress.org/plugins/flex-posts/)
 * [Support Threads](https://wordpress.org/support/plugin/flex-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/flex-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flex-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flex-posts/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [littlebizonline](https://wordpress.org/support/users/littlebizonline/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/exclude-self/#post-11764735)
 * Status: resolved