Search API
Besides llms.txt, the plugin splits your content into passages at its headings and indexes them, so any assistant can ask your site a question: a custom GPT, an MCP server, an automation in n8n or Make, or the plugin's own chat widget. A question returns the two paragraphs that answer it, not a whole page.
It runs on your own database, with its full-text search. No account, no key, no cost per search.
The index
The Search API tab shows how many posts and passages are indexed and how many are waiting.
- Content to index: the post types to include. Posts excluded in the editor, password-protected posts, and posts marked noindex (while noindex posts are skipped) stay out.
- Passage size: about 250 words suits most sites. Smaller passages are more precise but lose context.
- Saving a post updates its passages in the background. Changing which post types are indexed, or the passage size, re-indexes everything by itself. Rebuild the index does it on demand, 20 posts at a time.
If your database refuses a full-text index, the tab says so, and passages are found by matching words instead, unranked.
Endpoints
| Endpoint | Returns |
|---|---|
GET /wp-json/ltxt/v1/search?q=... | Matching passages as JSON, each with its page address, heading anchor and score. Optional limit and post_type. |
GET /wp-json/ltxt/v1/context?q=... | The same passages written out as one Markdown block with sources, ready to paste into a prompt |
GET /wp-json/ltxt/v1/manifest | Your llms.txt with the site name and summary |
GET /wp-json/ltxt/v1/post/{id} | One post in full, as Markdown |
/context is the quickest way to connect a custom GPT or an automation: send the question, put the answer in the prompt.
Access
The endpoints only return content that is already public.
- Rate limit: requests per visitor address per minute (60 by default). It keeps a looping integration from hammering the database. Behind a proxy or a CDN every visitor shares the proxy's address; the
ltxt_client_ipfilter lets you read the real one (Hooks). - API key: optional. With Require the key on every request on, callers send it as an
X-LTXT-Keyheader or akeyparameter. It keeps casual traffic away and lets you cut off one integration by issuing a new key.
Switching the index off makes every endpoint answer 404.