← 返回
安全合规 中文

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...
使用 WordPress REST API 进行路由发现、身份验证、读写、核心端点选择以及自定义命名空间检查。适用于需要与 WordPress REST API 交互的场景。
matthewxmurphy
安全合规 clawhub v0.6.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 979
下载
💾 68
安装
1
版本
#latest

概述

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

版本历史

共 1 个版本

  • v0.6.0 当前
    2026-03-29 17:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,158
security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,699
security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,586