WordPress REST API not responding - /wp-json/ endpoint missing

I’m having trouble with the WordPress REST API plugin. I installed it but can’t get it to work. When I try to access the /wp-json/ endpoint, I get a 404 error.

Here’s what happens when I test it:

$ curl http://mysite.com/wp-json/
404 Not Found
The requested URL /wp-json/ was not found on this server.

I’m not sure if it’s a problem with WordPress or the plugin. Has anyone run into this before? Any ideas on how to troubleshoot or fix it?

I’d really appreciate any help or suggestions. Thanks!

hey, i had similar issues. check ur wp-config.php file. make sure the WP_HOME and WP_SITEURL constants are set correctly. also, try disabling all plugins except REST API and see if that helps. sometimes other plugins can interfere w/ the API. good luck!

I’ve dealt with this headache before. One thing that’s often overlooked is the server’s mod_rewrite module. Make sure it’s enabled on your Apache server. You can check by creating a phpinfo() file and looking for mod_rewrite under the Apache modules section.

If that’s not it, take a look at your theme. Some poorly coded themes can interfere with the REST API. Try switching to a default WordPress theme like Twenty Twenty-Three and see if the problem persists.

Also, double-check your WordPress version. The REST API was introduced in version 4.7, so make sure you’re running at least that or newer.

Lastly, if you’re using a security plugin or firewall, it might be blocking API requests. Try temporarily disabling these and testing again. Just remember to re-enable them after troubleshooting!

I’ve encountered this issue before, and it’s often related to permalink settings. First, check if pretty permalinks are enabled in WordPress. Go to Settings > Permalinks and ensure it’s not set to ‘Plain’. If it is, switch to any other option and save.

If that doesn’t resolve it, try manually flushing the rewrite rules. You can do this by going to Settings > Permalinks and just clicking ‘Save Changes’ without making any changes.

Another thing to check is your .htaccess file. Make sure it’s writable and contains the necessary WordPress rewrite rules. If you’re comfortable editing it, you could try adding these lines:

# 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

If none of these work, it might be a server configuration issue. You may need to contact your hosting provider for further assistance.