1. Home
  2. Docs
  3. Troubleshooting
  4. Solving WordPress REST API Issues

Solving WordPress REST API Issues

Some QUIC.cloud issues are actually due to a problem with the WordPress REST API. One example of such an issue:

  • Error adding your domain’s IP address to your dashboard‘s Settings > Server IP.

It possible to solve issues like this simply by making sure the REST API is active.

Verify REST API is Active

Using curl, or an incognito browser window, visit this address, replacing example.com with your own domain:

https://example.com/?rest_route=/litespeed/v1/token

You should see something like this:

{"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}

Or you may see something like this:

{"_res":"ok"}

The last part of the string that is returned should say "status":404. If it does not, or you see any other status code besides 404, then the REST API is not working properly.

Diagnosing a Problem

If there is a problem with your REST API, here are a few possible causes:

REST API Disabled

You may have simply disabled REST API. Re-enable it to fix the problem. If you don’t know how to do this, the WordPress REST API Handbook may help.

Plugin Problems

  • You may have a security plugin that interferes with it.
  • You may have a plugin that controls or limits access, like a "maintenance mode" plugin.
  • You may have a plugin that is known to cause WP REST issues, such as the Perfmatters plugin.

Try disabling your plugins one-by-one to find the culprit.

ReWrite Rule Problems

The REST API link relies on a rewrite rule to work. Situation like these, that causes the WordPress rules not to be processed, are problematic:

  • You may have permalinks set to Plain or /index.php/.
  • You may have a rewrite rule in .htaccess that ends in [L] but appears before the WordPress section.

Change your permalinks setting, or move your rewrite rules after the WordPress section to solve the problem.

Was this article helpful to you? Yes 1 No 3