wp-rest-api

Register WordPress REST routes with controllers and JSON Schema validation.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/zenbuapps/zenbu-powers --skill wp-rest-api-zenbuapps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-rest-api
Source: https://github.com/zenbuapps/zenbu-powers/tree/main/skills/wp-rest-api
Command: npx skills add https://github.com/zenbuapps/zenbu-powers --skill wp-rest-api-zenbuapps

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

WordPress REST API development and debugging can be verbose and error-prone without consistent patterns for routes, controllers, validation, and response shaping.

Core Features & Use Cases

  • Expose and customize REST endpoints via register_rest_route and WP_REST_Controller.
  • Validate and sanitize inputs using JSON Schema and WP REST server utilities.
  • Debug permission errors, expose CPTs/taxonomies, and shape responses for clients.

Quick Start

Register a new REST route using rest_api_init, attach a WP_REST_Controller, and validate request arguments with a defined schema.

Frequently Asked Questions about wp-rest-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose custom post types and taxonomies via the WordPress REST API?

You can debug WordPress REST API permission errors by validating request arguments against a defined JSON Schema and coordinating route registration with WP_REST_Controller to enforce proper endpoint security.

What is the best way to validate and sanitize inputs for WordPress REST API endpoints?

The best way to validate and sanitize inputs for WordPress REST API endpoints is applying JSON Schema and WP REST server utilities to your registered routes, ensuring robust and standardized argument validation.

Does WordPress REST API development require JSON Schema for route registration?

WordPress REST API development uses JSON Schema to validate request arguments and sanitize inputs during route registration, coordinating controllers and schema validation to produce robust, error-free endpoints.

Why am I getting permission errors when exposing custom endpoints in WordPress?

Permission errors when exposing custom endpoints in WordPress often occur when route registration lacks proper WP_REST_Controller attachment or JSON Schema validation, which are required to secure REST routes and debug access issues.

Can I shape API responses and expose custom meta fields using a WP_REST_Controller?

You can shape API responses and expose custom meta fields by attaching a WP_REST_Controller to your route, coordinating schema validation and field exposure to produce customized, standards-compliant client responses.