list-posts
Retrieve and filter WordPress posts by parameters like author, date, status, or search term using secure API authentication. Manage post collections programmatically with pagination and sorting options.
Instructions
Get a list of posts with comprehensive filtering options
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Limit response to posts published after a given ISO8601 compliant date | |
| author | No | Limit result set to posts assigned to specific authors | |
| authorExclude | No | Ensure result set excludes posts assigned to specific authors | |
| before | No | Limit response to posts published before a given ISO8601 compliant date | |
| categories | No | Limit result set to items with specific terms assigned in the categories taxonomy | |
| categoriesExclude | No | Limit result set to items except those with specific terms assigned in the categories taxonomy | |
| context | No | Scope under which the request is made | view |
| exclude | No | Ensure result set excludes specific IDs | |
| include | No | Limit result set to specific IDs | |
| modifiedAfter | No | Limit response to posts modified after a given ISO8601 compliant date | |
| modifiedBefore | No | Limit response to posts modified before a given ISO8601 compliant date | |
| offset | No | Offset the result set by a specific number of items | |
| order | No | Order sort attribute ascending or descending | desc |
| orderby | No | Sort collection by post attribute | date |
| page | No | Current page of the collection | |
| password | Yes | WordPress application password | |
| perPage | No | Maximum number of items to be returned | |
| search | No | Limit results to those matching a string | |
| searchColumns | No | Array of column names to be searched | |
| siteUrl | Yes | WordPress site URL | |
| slug | No | Limit result set to posts with one or more specific slugs | |
| status | No | Limit result set to posts assigned one or more statuses | |
| sticky | No | Limit result set to items that are sticky | |
| tags | No | Limit result set to items with specific terms assigned in the tags taxonomy | |
| tagsExclude | No | Limit result set to items except those with specific terms assigned in the tags taxonomy | |
| taxRelation | No | Limit result set based on relationship between multiple taxonomies | |
| username | Yes | WordPress username |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"after": {
"description": "Limit response to posts published after a given ISO8601 compliant date",
"type": "string"
},
"author": {
"description": "Limit result set to posts assigned to specific authors",
"items": {
"type": "number"
},
"type": "array"
},
"authorExclude": {
"description": "Ensure result set excludes posts assigned to specific authors",
"items": {
"type": "number"
},
"type": "array"
},
"before": {
"description": "Limit response to posts published before a given ISO8601 compliant date",
"type": "string"
},
"categories": {
"description": "Limit result set to items with specific terms assigned in the categories taxonomy",
"items": {
"type": "number"
},
"type": "array"
},
"categoriesExclude": {
"description": "Limit result set to items except those with specific terms assigned in the categories taxonomy",
"items": {
"type": "number"
},
"type": "array"
},
"context": {
"default": "view",
"description": "Scope under which the request is made",
"enum": [
"view",
"embed",
"edit"
],
"type": "string"
},
"exclude": {
"description": "Ensure result set excludes specific IDs",
"items": {
"type": "number"
},
"type": "array"
},
"include": {
"description": "Limit result set to specific IDs",
"items": {
"type": "number"
},
"type": "array"
},
"modifiedAfter": {
"description": "Limit response to posts modified after a given ISO8601 compliant date",
"type": "string"
},
"modifiedBefore": {
"description": "Limit response to posts modified before a given ISO8601 compliant date",
"type": "string"
},
"offset": {
"description": "Offset the result set by a specific number of items",
"type": "number"
},
"order": {
"default": "desc",
"description": "Order sort attribute ascending or descending",
"enum": [
"asc",
"desc"
],
"type": "string"
},
"orderby": {
"default": "date",
"description": "Sort collection by post attribute",
"enum": [
"author",
"date",
"id",
"include",
"modified",
"parent",
"relevance",
"slug",
"include_slugs",
"title"
],
"type": "string"
},
"page": {
"default": 1,
"description": "Current page of the collection",
"minimum": 1,
"type": "number"
},
"password": {
"description": "WordPress application password",
"type": "string"
},
"perPage": {
"default": 10,
"description": "Maximum number of items to be returned",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"search": {
"description": "Limit results to those matching a string",
"type": "string"
},
"searchColumns": {
"description": "Array of column names to be searched",
"items": {
"type": "string"
},
"type": "array"
},
"siteUrl": {
"description": "WordPress site URL",
"format": "uri",
"type": "string"
},
"slug": {
"description": "Limit result set to posts with one or more specific slugs",
"items": {
"type": "string"
},
"type": "array"
},
"status": {
"default": [
"publish"
],
"description": "Limit result set to posts assigned one or more statuses",
"items": {
"enum": [
"publish",
"future",
"draft",
"pending",
"private"
],
"type": "string"
},
"type": "array"
},
"sticky": {
"description": "Limit result set to items that are sticky",
"type": "boolean"
},
"tags": {
"description": "Limit result set to items with specific terms assigned in the tags taxonomy",
"items": {
"type": "number"
},
"type": "array"
},
"tagsExclude": {
"description": "Limit result set to items except those with specific terms assigned in the tags taxonomy",
"items": {
"type": "number"
},
"type": "array"
},
"taxRelation": {
"description": "Limit result set based on relationship between multiple taxonomies",
"enum": [
"AND",
"OR"
],
"type": "string"
},
"username": {
"description": "WordPress username",
"type": "string"
}
},
"required": [
"siteUrl",
"username",
"password"
],
"type": "object"
}