Hardening WordPress REST API and WP-JSON Endpoints Against Automated Probing

While the WordPress REST API powers modern headless frontends and seamless mobile apps, open /wp-json/ endpoints frequently expose sensitive user enumeration details to malicious scrapers and brute-force botnets.

Cybersecurity lock and encrypted network code
Hardening API routes keeps backend user data safe from automated discovery.

Assessing API Vulnerabilities

Review the OWASP API Security Project to understand the risks of unauthenticated endpoint queries. Leaving default routes unprotected allows bad actors to map author usernames, plugin paths, and draft revisions.

Three Critical Hardening Tactics

  • Disable User Enumeration: Require active authentication cookies or Bearer tokens to access /wp/v2/users.
  • Deploy WAF Rate Limiting: Configure edge firewall rules to throttle excessive requests targeting JSON endpoints.
  • Input Sanitization: Always attach strict validate_callback parameters to custom REST endpoints.

Further Security Reading