---
url: /hooks/filters/wpce-relation-list-posts.md
description: Filter the posts returned by WPCE relation and post input searches.
---

# `wpce_relation_list_posts`&#x20;

Filters the posts fetched on the `relationslist` endpoint [e.g. for the `post` input type](../../documentation/input-types/post).

## Parameters

1. `object[] $posts`

   The available posts, in the format returned by the `post` input type.

## Example

```php
// Only keep posts with ID different from 1
add_filter('wpce_relation_list_posts', function (array $posts) {
  return array_filter($posts, fn ($post) => $post->id !== 1);
});
```
