文档

WordPress REST API

试用

Work with the WordPress REST API for route discovery, authentication, reads and writes, core endpoint selection, and custom namespace inspection. Use when a...

它能做什么

Work with the WordPress REST API for route discovery, authentication, reads and writes, core endpoint selection, and custom namespace inspection. Use when a...

技能文档

WordPress REST API

Use this skill when the correct interface is HTTP against a WordPress site, not shell access with wp.

This skill is built around two facts:

  • WordPress core ships a large REST surface under /wp-json
  • the truly complete endpoint list is site-specific because plugins and custom code can register more routes

Treat the reference files as the core map and use the discovery script for the live map.

Use This Skill For

  • inspecting /wp-json on a live site
  • choosing the right core route before writing code or automation
  • authenticating with application passwords for machine-to-machine calls
  • checking cookie and nonce-based admin flows
  • inspecting custom plugin routes and namespaces
  • figuring out which methods and args a route accepts
  • designing or reviewing register_rest_route() implementations

Do Not Use This Skill For

  • normal shell-based site administration when wp access already exists
  • WP-CLI command or package development
  • pretending the static reference files can enumerate plugin routes on every site

Workflow

1. Discover The Live Route Index

Start with:

scripts/inspect-rest-api.sh --site https://example.com

This fetches the site index at /wp-json/, prints the namespaces, and lists the live routes that site exposes.

If you need one route only:

scripts/inspect-rest-api.sh --site https://example.com --route /wp/v2/posts
scripts/inspect-rest-api.sh --site https://example.com --route /wp/v2/posts --method OPTIONS

Read references/core-endpoints.md before assuming a core route name from memory.

2. Choose The Right Auth Model

Default rule:

  • external automation: use application passwords over HTTPS
  • logged-in browser admin flow: use cookie auth plus nonce handling
  • public read-only data: use unauthenticated GET only when the site exposes it intentionally

Read references/auth-and-discovery.md.

3. Prefer Core Namespaces First

Core routes are more stable than plugin routes.

Common starting points:

  • posts, pages, media, comments, categories, tags
  • users and settings when authenticated
  • templates, template parts, patterns, and block-editor related routes on newer installs
  • plugins and themes only when the target site and permissions allow them

4. Inspect Custom Routes Live

For plugin or theme APIs, do not guess.

Use the discovery index and OPTIONS:

scripts/inspect-rest-api.sh --site https://example.com --route /my-namespace/v1/report --method OPTIONS

Then read references/custom-route-rules.md if you are implementing or reviewing the server-side route registration.

5. Keep Calls Small And Explicit

Default patterns:

  • use ?_fields= to trim large responses
  • use page, per_page, search, orderby, and order instead of client-side filtering when possible
  • check pagination headers such as X-WP-Total and X-WP-TotalPages
  • use OPTIONS before write automation when you do not control the site code

Files

  • scripts/inspect-rest-api.sh: discover the live route index or inspect a single route with GET or OPTIONS
  • references/core-endpoints.md: core route families worth checking before you inspect plugin namespaces
  • references/auth-and-discovery.md: application passwords, cookie auth, nonces, and route discovery rules
  • references/custom-route-rules.md: implementation-side guidance for registering or reviewing custom routes

相关技能

Operate WordPress installs through WP-CLI for inspection, core maintenance, plugin and theme management, users, options, content, media, cron, database tasks...

44 次安装2 星标

通过 REST API 管理 WordPress 内容,带显式审批、批量演练与插件/CPT 工具支持。

61 次安装2 星标

Read and write WordPress.com site content through WordPress.com's hosted MCP server. Thin pass-through to WordPress.com's official MCP; the live tool catalog...

28 次安装

Build, inspect, and extend WP-CLI command code using the documented stable internal API. Use when the task involves custom WP-CLI commands, package bootstrap...

25 次安装

通过托管的 OAuth GraphQL 接口查询与管理 Linear 的 issue、项目、团队、周期、标签和评论。

作者 byungkyu517 次安装18 星标

通过托管 OAuth 代理对接 Asana API,统一处理任务、项目、空间、用户与 Webhook。

601 次安装6 星标