wp-rest-api
Skill by sharkrebel
Guides an AI assistant through building, extending, and debugging WordPress REST API routes, controllers, schema validation and permissions. Built for WordPress plugin and theme developers. Targets WordPress 6.9 and later.
Install wp-rest-api
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sharkrebel/everything-everywhere-for-antigravity /tmp/everything-everywhere-for-antigravity && mkdir -p ~/.claude/skills && cp -r /tmp/everything-everywhere-for-antigravity/skills/wp-rest-api ~/.claude/skills/wp-rest-apiRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sharkrebel/everything-everywhere-for-antigravity /tmp/everything-everywhere-for-antigravity && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/everything-everywhere-for-antigravity/skills/wp-rest-api ~/.gemini/antigravity-cli/skills/wp-rest-apiAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The wp-rest-api skill guides an AI assistant through building, extending, and debugging WordPress REST API endpoints and routes. It covers register_rest_route, WP_REST_Controller classes, argument schema and validation, permission callbacks and authentication, response shaping, and exposing custom post types and taxonomies with show_in_rest. The procedure points the agent to reference files on routes, schema, responses, authentication and discovery.
The skill lists steps for choosing an approach, registering routes safely with namespaces and permission callbacks, validating and sanitizing request arguments, and adding fields or meta to responses. It also includes a verification checklist and common failure modes such as 404, 401 and 403 errors. It is aimed at WordPress plugin and theme developers. It targets WordPress 6.9+ and PHP 7.2.24+ and expects a filesystem agent with bash and node.
Written from the project's SKILL.md and checked against it.
What it can do
- Expose CPTs and taxonomiesUses show_in_rest and rest_base to expose custom content types under wp/v2.
- Register custom routesUses register_rest_route on rest_api_init, preferring a WP_REST_Controller subclass for non-trivial endpoints.
- Validate request argumentsApplies args schemas with rest_validate_value_from_schema and rest_sanitize_value_from_schema.
- Check permissionsRequires a permission_callback and capability checks instead of only checking that a user is logged in.
- Shape responsesAdds computed fields with register_rest_field and meta with register_meta and show_in_rest.
- Debug REST errorsTroubleshoots 404, 401 and 403 errors, nonce issues and missing fields in REST responses.
What you need
- WordPress 6.9 or later
- PHP 7.2.24 or later
- Bash and Node.js
- WP-CLI for some workflows
Try asking
- Add a custom REST route under my-plugin/v1 with a permission callback.
- Expose my custom post type in the wp/v2 REST API with show_in_rest.
- Debug why my REST endpoint returns 403 for logged-in users.
Good to know
- Targets WordPress 6.9 and later.
- Access to content.raw with ?context=edit requires authentication.
- The per_page parameter is capped at 100.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/wp-rest-api/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md5 KB -
references/authentication.md627 B -
references/custom-content-types.md760 B -
references/discovery-and-params.md730 B -
references/responses-and-fields.md1 KB
Show all 7 files
-
references/routes-and-endpoints.md1 KB -
references/schema.md964 B
Alternatives to wp-rest-api
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
wp-rest-api: common questions
Which WordPress versions does this skill target?
The skill targets WordPress 6.9+ and PHP 7.2.24+. If the target site is below 6.9, the skill says to call that out.
How does it handle authentication for REST endpoints?
For wp-admin JavaScript it uses cookie auth with an X-WP-Nonce header. For external clients it suggests application passwords or an auth plugin.
Can it expose custom post types to the WordPress REST API?
Yes. It uses show_in_rest, rest_base and optionally rest_controller_class, and checks that the routes appear under wp/v2.
How do I install wp-rest-api?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is wp-rest-api free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is wp-rest-api safe to use?
It scores 79 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to wp-rest-api?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
