WordPress Extended icon

WordPress Extended

WordPress REST API with Custom Post Types, ACF and Meta Fields

Actions17

Custom Post Type → Get Many

AI-generated

Summary

Retrieves multiple records from a specified Custom Post Type using the WordPress REST API, supporting pagination, filtering, and sorting options.

Inputs

  • postType (required) — The Custom Post Type to query. Choose from a dynamically loaded list or specify an ID using an expression.
  • returnAll — Whether to fetch all available results (triggers pagination internally) or stop after the configured limit.
  • limit — Maximum number of results to return when 'Return All' is disabled. Default is 10, maximum is 100.
  • search — Search string to filter results.
  • status — The post status to filter by (e.g., 'publish', 'draft').
  • order — Sort order of results (ASC or DESC).
  • orderBy — Field to sort results by (e.g., 'date', 'title', 'id', 'modified').
  • after — Limit results to items published after a specific ISO8601 date.
  • before — Limit results to items published before a specific ISO8601 date.
  • author — Limit results to items by specific author(s).

Output shape

A list of items, each containing a JSON object representing a Custom Post Type record from the WordPress REST API.

If 'Return All' is enabled, the node internally handles pagination by requesting additional pages until all results are fetched. Results respect the sorting and filtering criteria configured in the 'Options' collection.

Examples

Example 1: Retrieve the first 10 published 'products' sorted by creation date in descending order.

Select 'products' for Post Type, disable Return All, set Limit to 10, Status to 'publish', Order to 'DESC', and Order By to 'date'.

Example 2: Fetch all 'events' that occurred after January 1, 2023.

Select 'events' for Post Type, enable Return All, set After to '2023-01-01T00:00:00Z'.

Example 3: Get all 'news' posts containing the word 'update' sorted by title.

Select 'news' for Post Type, enable Return All, set Search to 'update', Order to 'ASC', and Order By to 'title'.

Links

Discussion