Search WordPress Content
wp_search_contentSearch WordPress posts and pages by keyword using the native REST API endpoint. Returns paginated results with ID, title, URL, type, and subtype.
Instructions
Cross-content keyword search across posts and pages using WP's built-in /wp/v2/search endpoint. Lighter-weight than wp_list_posts(search=...) because it returns just (id, title, url, type, subtype) per match.
Args:
query (string): Required, minimum 2 characters.
type (enum): post | page | any. Default 'any' (searches both).
limit (number): Page size, 1-100. Default 20.
offset (number): Pagination offset. Default 0.
response_format (enum): markdown | json. Default 'markdown'.
Returns: Paginated envelope of search hits with shape: { "total": number, "count": number, "offset": number, "items": [{ "id": number, "title": string, "url": string, "type": string, "subtype": string }], "has_more": boolean, "next_offset": number }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Restrict to posts, pages, or both. | any |
| limit | No | Maximum results to return (1-100). Default 20. | |
| query | Yes | Search string (minimum 2 characters). | |
| offset | No | Number of results to skip for pagination. Default 0. | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable. | markdown |