Sébastien Laframboise

The WordPress REST API is unresponsive: diagnostic method

The WordPress REST API is unresponsive: diagnostic method

When the WordPress REST API fails, the block editor may refuse to save content. An external application can also lose access to the site. However, the problem is not always caused by WordPress itself.

The REST API lets WordPress and external services exchange data in JSON format. It specifically supports the block editor and integrations. The official WordPress REST API documentation also notes that private content and sensitive actions require proper authentication.

The right approach is to identify the first link that fails: public access, routing, security, authentication, or permissions. Make one change at a time and record the result.

Start by identifying the specific symptom

Before disabling a plugin or changing a server rule, observe the message and the context. The same apparent failure can hide very different causes.

  • The editor shows an invalid response or can’t publish: the API is often unreachable, blocked, or its JSON is corrupted.
  • An external integration returns 401 or 403: first check the authentication, the account used, and the permissions.
  • The API address returns 404: examine the permalinks and rewrite rules.
  • An error 500 appears: look for a PHP error, a plugin conflict, or an incompatible server rule.
  • Only certain requests fail: the endpoint, the HTTP method, or the requested capability may be at fault.

Open a private window, then visit the address https://votre-domaine.tld/wp-json/. On a site where the public API is accessible, WordPress should respond with a JSON document. If you receive an HTML login page, a security challenge, an unexpected redirect, or a server error, keep that detail: it guides the diagnosis.

Check routing and permalinks first

A response of 404 to /wp-json/ often indicates the request isn’t reaching WordPress correctly. The public site may remain functional while its technical routes fail.

Re-save the permalinks

In the admin, open Settings > Permalinks, then click Save Changes without changing the structure. This action rebuilds the rewrite rules managed by WordPress.

Then test again /wp-json/, the save in the editor and the affected integration. If the issue disappears, still monitor upcoming server changes, cache updates, or security plugin changes. To review URL structure choices without confusing SEO and troubleshooting, see the WordPress permalinks settings.

Compare the requested paths and methods

An unknown route doesn’t prove the entire API is down. An integration may call a removed route, a misspelled route, or one provided by an inactive plugin. Verify the full address, the requested method — GET, POST, PUT, PATCH, or DELETE — and the integration version.

If the root /wp-json/ responds but only one route fails, focus the investigation on the plugin or service that provides that route. Don’t reset the whole site for a localized error.

Interpret the HTTP code before fixing

The response code quickly narrows the list of possible causes. You should also read the response body, however, because WordPress may add a more specific error code there.

Observed responsePriority lead
401 UnauthorizedMissing, expired, or incorrectly transmitted credentials.
403 Access deniedFirewall, security rule, insufficient permission, or IP address block.
404 Not foundPermalinks, rewrite rules, wrong route, or a plugin that no longer loads.
500 Internal errorPHP error, plugin conflict, theme issue, or server limit.
HTML response instead of JSONRedirect, login page, block page, or intrusive message.

An 403 error deserves special attention. It may be justified by a security policy, but it may also block a legitimate function. See how to diagnose an 403 error on WordPress before loosening a global protection.

Distinguish public access from authenticated access

A public route can respond without a login, whereas creating a post, uploading, or viewing private data requires an authorized account. So it’s normal for a public test to succeed while a write action fails.

In the WordPress admin

When you use the connected editor, WordPress normally relies on your session cookies and a temporary token called a nonce. The official REST authentication documentation explains that an internal request without a valid nonce is treated as unauthenticated, even if the person is logged in in their browser.

Log out, log back in, then fully reload the editor. If the issue occurs only in one browser, clear the site cache and temporarily disable browser extensions that modify requests or privacy.

For an external application or automation

Avoid giving a service your account’s main password. WordPress instead offers application passwords: distinct, revocable credentials tied to a specific integration. They’re intended for programmatic API access and must be used over HTTPS, as the documentation on application passwords.

Create a separate credential for each service. Give it a clear name, verify the associated account, then revoke it if the integration is no longer used. This method also simplifies diagnosis: you know exactly which access is failing.

Account permissions still matter. Successful authentication doesn’t automatically grant the right to modify any content. So check roles and permissions in WordPress before elevating a user’s rights.

Isolate plugins, the theme, and security rules

Security, cache, optimization, or authentication plugins can filter the API. They can also require login for all routes or block certain HTTP methods. An external firewall can have the same effect before WordPress even receives the request.

If you have a test environment, reproduce the issue there. Then disable one plugin at a time, starting with those affecting security, cache, headers, or connections. Test after each change. Immediately reactivate anything not at fault.

If the issue disappears after disabling a plugin, look for a more targeted setting. For example, an exception limited to the affected route or integration is preferable to fully disabling the protection.

Plugins can also enforce authentication for all REST requests. The official REST API FAQ reminds that disabling the API can break WordPress admin features that depend on it. So keep necessary routes accessible while limiting sensitive data.

Inspect the server and the logs

If the API still fails with plugins ruled out, check the host’s error logs at the exact time of the test. Look for PHP errors, resource limits, HTTP method denials, and redirect loops.

For authenticated requests, also verify that the server or proxy passes the Authorization header through to WordPress. The official documentation notes that some environments may strip this header, causing authentication to fail despite valid credentials.

Provide the host with precise details: test time, called URL, HTTP method, status code, and a snippet of the response. This information prevents overly broad action and speeds up analysis.

Confirm the fix with the three affected use cases.

A fix is complete only if it resolves the real-world scenario. First test the API root. Then save a draft in the editor. Finally, repeat the action in the app or automation that had failed.

Document the cause, the setting changed, and the date. That way you can spot a regression after an update or hosting change. This record also helps maintain proportional security without unnecessarily blocking functions your site depends on.