WordPress JSON API returns only 404 errors WordPress JSON API returns only 404 errors wordpress wordpress

WordPress JSON API returns only 404 errors


It is an mod_rewrite issue.

Reason is one of these in your .htaccess:

  • not existing
  • wrong permissions
  • screwed up

Try the htaccess documentation on Wordpress for your .htaccess:

## BEGIN WordPress<IfModule mod_rewrite.c>    RewriteEngine On    RewriteBase /    RewriteRule ^index\.php$ - [L]    RewriteCond %{REQUEST_FILENAME} !-f    RewriteCond %{REQUEST_FILENAME} !-d    RewriteRule . /index.php [L]</IfModule># END WordPress


Old question and answer, but for anyone coming here recently via search results (like me), /wp-json/posts should at least bring a JSON result (albeit still a 404 error), and /wp-json should list some available routes in JSON.

If it doesn't (e.g. it shows an Apache or other 404 error page), it's probably a permalinks issue