wp-rest-api
Use when building, extending, or debugging WordPress REST API endpoints/routes: register_rest_route, WP_REST_Controller/controller classes, schema/argument validation, permission_callback/authentication, response shaping, register_rest_field/register_meta, or exposing CPTs/taxonomies via show_in_rest.
Security Assessment
About wp-rest-api
The wp-rest-api skill is designed to help developers build, extend, and troubleshoot WordPress REST API functionality in WordPress 6.9+ environments. It provides a structured workflow for creating and updating REST endpoints, exposing custom content through the API, implementing request validation, and resolving common issues such as authentication failures, permission errors, and route registration problems. The skill guides users through locating existing REST integrations, selecting the appropriate implementation approach, and following WordPress REST API best practices.
Its capabilities include registering custom routes with register_rest_route(), organizing complex endpoints through WP_REST_Controller-based controller classes, validating and sanitizing request arguments, shaping API responses, and extending responses with custom fields or metadata. The skill also covers exposing custom post types and taxonomies through REST, configuring authentication and authorization mechanisms, supporting discovery and pagination features, and working with response links and embedded resources. Emphasis is placed on proper permission_callback usage, schema-driven validation, and standards-compliant REST behavior.
This skill is intended for WordPress plugin, theme, and mu-plugin developers who need to implement or maintain REST API integrations. It is useful for projects that require custom API endpoints, REST-enabled content models, client-facing API enhancements, or debugging of existing REST functionality. Teams working in filesystem-based development environments, particularly those using bash, node, and optionally WP-CLI, can use this skill to follow a consistent and maintainable approach to WordPress REST API development.
FAQ
When should I use the wp-rest-api skill?
Use it when creating or modifying WordPress REST API routes, exposing content through REST, adding custom fields or metadata to responses, implementing validation, or troubleshooting authentication and permission issues.
What WordPress versions are supported?
The skill targets WordPress 6.9 and later, with PHP 7.2.24 or newer.
What information is required before using this skill?
You should provide the repository root, the target plugin, theme, or mu-plugin path, the desired namespace and route structure, the authentication approach, and any WordPress version constraints.
Does the skill support custom post types and taxonomies?
Yes. It includes guidance for exposing custom post types and taxonomies through the REST API using options such as show_in_rest, rest_base, and optional controller configuration.
Are there any environment requirements?
The skill assumes a filesystem-based environment with bash and node available. Some workflows may also require WP-CLI.
Install wp-rest-api
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
wordpress/agent-skills