Title: query_posts exclude current post
Last modified: August 20, 2016

---

# query_posts exclude current post

 *  [hdmusicvideos](https://wordpress.org/support/users/hdmusicvideos/)
 * (@hdmusicvideos)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/query_posts-exclude-current-post/)
 * Hello, I’m using this to show some related post… but I don’t know how to exclude
   a post by current id, Example: In a post I have #A – related posts shows: #A,#
   D, #K
 * Is there a way to exclude the (#A related post) from (#A post) ?
 * The code:
 * _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   The maximum number of lines of code that you can post in these forums is **ten
   lines**. Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * Any help would be greatly appreciated.

The topic ‘query_posts exclude current post’ is closed to new replies.

## Tags

 * [exclude](https://wordpress.org/support/topic-tag/exclude/)
 * [id](https://wordpress.org/support/topic-tag/id/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [hdmusicvideos](https://wordpress.org/support/users/hdmusicvideos/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/query_posts-exclude-current-post/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
