# Get Posts

Use GP Populate Anything to find WordPress posts, pages, or custom post types and return them as a collection.

## When to use it

Use this to look up content for a digest, find a related post, or process a group of posts with [For Each](/documentation/flowcrafter/nodes/flow/for-each/).

## Settings

With GP Populate Anything active, configure which posts to find and how to return them.

![Get Posts settings showing the result limit, post-data toggle, filter groups, and ordering](/documentation/flowcrafter/screenshots/action-get-posts-settings.png)

| Setting | What it does |
|---|---|
| **Limit** | Sets the maximum number of posts to return. Defaults to `25` and accepts [flow tags](/documentation/flowcrafter/building/using-flow-tags/). |
| **Return** | **Post IDs only** returns summary data while For Each processes the saved collection. Choose **Full posts** to add the posts to `items` for other list-processing steps. |
| **Filter Groups** | Narrows the results by Post Type, Post Status, Category, custom fields, or other post properties. Conditions within a group use **AND**; separate groups use **OR**. |
| **Ordering** | Chooses the property to sort by and the order: **Ascending**, **Descending**, or **Random**. |

See the [GP Populate Anything documentation](https://gravitywiz.com/documentation/gravity-forms-populate-anything/) for all available post filters.

## Output and branches

The step exposes **Output** and **Error** branches. Successful queries continue through **Output**. Matching posts are stored as a collection so For Each can load each current post and expose values such as `{{item.ID}}` and `{{item.post_title}}`.

There is no separate “no results” branch; no matches produce an empty collection and continue through **Output**. Set **Return** to **Full posts** when another list-processing step needs the whole list at once.

## Example

Find up to 10 published posts in the **News** category for a digest:

1. Set **Limit** to `10`.
2. Add one filter group with **Post Type is Post**, **Post Status is Published**, and **Category is News**.
3. Set **Ordering** to **Post Date**, **Descending** to return the newest posts first.
4. Connect For Each to process the returned posts, using `{{item.post_title}}` for each title.

![Get Posts configured to find the 10 newest published posts in the News category](/documentation/flowcrafter/screenshots/action-get-posts-example.png)
