wp2shell: more than a month later. Confirm 6.8.6, 6.9.5, 7.0.2. Patched is not clean.

Read the advisory

REST API documentation best practices

Short rules for REST API docs that people can use, plus WordPress-specific notes on auth, capabilities, and not exposing more than you mean to.

Topics Hardening & checklists

Lars Koudal

Lars Koudal

Updated Published

API docs exist so someone else (or future you) can call endpoints without reading the source. Fancy marketing pages do not replace clear examples.

Writing API documentation

Documentation that works

  1. State the base URL, auth method, and error shape up front.
  2. Show real request and response examples (curl or HTTP), not only abstract schemas.
  3. Document every parameter that changes behavior, including defaults and limits.
  4. Version the API and say what breaks between versions.
  5. Keep docs next to the code so they get updated in the same PR when possible.

WordPress REST API notes

WordPress ships a REST API under /wp-json/. Custom routes should check capabilities the same way admin screens do (least privilege). Do not invent “secret” endpoints that skip permission_callback. Treat application passwords and OAuth clients like admin credentials.

If you only need to consume or expose data safely, start with WordPress API integration basics and keep site hardening on the WordPress security checklist. Docs without access control are a howto for attackers.

Found this useful? Share it.

Larger screenshot