rest_no_route WordPress Origin: Application & API Last updated 13 Oct 2026

WordPress REST API: {"code":"rest_no_route","message":"No route was found matching the URL and request method."}

The REST endpoint doesn’t exist for that URL and HTTP method — wrong namespace/route, plugin not active, or route registered too late.

Exact message you may see No route was found matching the URL and request method
Seen on: WordPress

Meaning

Routes must be registered on rest_api_init. Typos in the namespace, using GET where only POST is registered, disabled plugins, or permalinks set to Plain (requiring ?rest_route=) cause it.

Common causes

  • Route registered outside rest_api_init or not at all
  • Wrong method for the route
  • Plugin providing the route inactive
  • Plain permalinks (use ?rest_route=/ns/route)

⚡ Quick fix

  1. List routes: GET /wp-json/
  2. Register with register_rest_route on rest_api_init
  3. Use the right method or add it to the route

Detailed fix by platform

WordPress

  1. php
    add_action('rest_api_init', function () {
        register_rest_route('myplugin/v1', '/items', [
            'methods' => 'GET', 'callback' => 'myplugin_items', 'permission_callback' => '__return_true',
        ]);
    });

How to diagnose

  1. Index — Route listed in /wp-json?
  2. Method — Allowed methods
  3. Permalinks — Plain?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

1019 — Cloudflare Error 1019: Compute server error (Workers) (Cloudflare)1019404 — HTTP 404 Not Found (HTTP)404405 — HTTP 405 Method Not Allowed (HTTP)405Cannot GET — API Error: Cannot GET /api/... / No route matches / The route could not be found (API)Cannot GETNextRouter was not mounted — Error: NextRouter was not mounted. (React)NextRouter was not mo…No routes matched — No routes matched location "/x" (React)No routes matchedNot a valid JSON response — WordPress: Updating failed. The response is not a valid JSON response. (WordPress)Not a valid JSON resp…path-to-regexp — TypeError: Missing parameter name at 1 (path-to-regexp) (Node.js)path-to-regexprest_no_r…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.