Title: Exclude specific post IDs
Last modified: June 8, 2025

---

# Exclude specific post IDs

 *  [aaron13223](https://wordpress.org/support/users/aaron13223/)
 * (@aaron13223)
 * [12 months ago](https://wordpress.org/support/topic/exclude-specific-post-ids/)
 * Hi There!
 * I am using YARPP to display related woocommerce products using `yarpp_related()`
 * I wanted to use YARPP on the cart page as well. I am able to easily set the post
   ID on basis of which the related products are shown but I want to exclude other
   products that might already be in the cart.
 * I do have an array of post IDs but as far I could tell from reading the YARPP
   documentation, the exclude parameter in the arguments is to exclude certain taxonomies
   and not individual posts.
 * How would you suggest we go about this? (Excluding certain posts based on their
   IDs)
 * One dirty way would be capture the `yarpp_related()` output and then removing
   the duplicate ones but I would prefer not to have such a crude solution:p
 * Let me know what you think! Thanks a lot!

The topic ‘Exclude specific post IDs’ is closed to new replies.

 * ![](https://ps.w.org/yet-another-related-posts-plugin/assets/icon-256x256.png?
   rev=2549977)
 * [YARPP - Yet Another Related Posts Plugin](https://wordpress.org/plugins/yet-another-related-posts-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yet-another-related-posts-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [aaron13223](https://wordpress.org/support/users/aaron13223/)
 * Last activity: [12 months ago](https://wordpress.org/support/topic/exclude-specific-post-ids/)
 * Status: not resolved