wp_get_posts
Retrieve WordPress posts with filtering by type, status, author, or search terms, and pagination options for development workflows.
Instructions
Get WordPress posts with optional filtering and pagination
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| author_id | No | Filter by author ID | |
| limit | No | Number of posts to retrieve (default: 10) | |
| offset | No | Offset for pagination (default: 0) | |
| post_status | No | Post status (publish, draft, private, etc.) | publish |
| post_type | No | Post type (default: post) | post |
| search | No | Search in post title and content |
Input Schema (JSON Schema)
{
"properties": {
"author_id": {
"description": "Filter by author ID",
"type": "number"
},
"limit": {
"default": 10,
"description": "Number of posts to retrieve (default: 10)",
"type": "number"
},
"offset": {
"default": 0,
"description": "Offset for pagination (default: 0)",
"type": "number"
},
"post_status": {
"default": "publish",
"description": "Post status (publish, draft, private, etc.)",
"type": "string"
},
"post_type": {
"default": "post",
"description": "Post type (default: post)",
"type": "string"
},
"search": {
"description": "Search in post title and content",
"type": "string"
}
},
"type": "object"
}