WordPress - Get Posts
Description
Section titled “Description”This module allows querying and searching posts or articles from a WordPress site. Supports filters by status, category, text search, pagination, and sorting.
Configuration
Section titled “Configuration”Credentials
Section titled “Credentials”| Field | Description | Example |
|---|---|---|
url | WordPress site base URL | https://my-site.com |
username | WordPress username | admin |
application_password | Application password generated in WordPress | xxxx xxxx xxxx xxxx |
Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | WordPress credential |
| post_id | text | No | Specific ID. If empty, lists all |
| search | text | No | Search term |
| status | select | No | Filter: publish, draft, pending, private, any |
| categories | text | No | Filter by category ID |
| per_page | number | No | Posts per page (1-100). Default: 10 |
| page | number | No | Page number. Default: 1 |
| orderby | select | No | Sort by: date, title, modified, id |
Output
Section titled “Output”{ "success": true, "posts": [ { "id": 123, "title": { "rendered": "Mi Post" }, "content": { "rendered": "<p>Content...</p>" }, "status": "publish", "link": "https://misitio.com/mi-post/", "date": "2024-01-15T10:30:00", "categories": [1, 5], "tags": [3] } ], "total": 45, "page": 1, "per_page": 10}Usage Example
Section titled “Usage Example”List latest published posts
Section titled “List latest published posts”{ "status": "publish", "per_page": 10, "orderby": "date"}Posts from a category
Section titled “Posts from a category”{ "categories": "5", "status": "publish"}Search post by text
Section titled “Search post by text”{ "search": "WordPress tutorial"}API Used
Section titled “API Used”- Endpoint:
GET /wp-json/wp/v2/posts - Documentation: WordPress REST API - Posts
- Posts include content rendered in HTML
- Categories and tags are returned as arrays of IDs
- The total field indicates the total number of posts matching the filters
- By default sorted by date descending
Related Nodes
Section titled “Related Nodes”- WordpressCreatePost - Create a new post
- WordpressUpdatePost - Update an existing post
- WordpressDeletePost - Delete a post
- WordpressGetCategories - Get categories for filtering