
REST API Error
WordPress REST API Error: Troubleshooting Guide
Quick Fix
Check your site URL and clear cache. Disable all plugins, switch to a default theme, and test the REST API endpoint again. If it still fails, review .htaccess and SSL settings.
What it Means
The REST API Error appears when WordPress cannot process API requests. It usually shows as a 500 or 403 response when accessing /wp-json/ endpoints. The error indicates that something on the server or in WordPress is blocking or misconfiguring the API.
Possible Causes
- 1Plugin conflict or buggy code
- 2Theme conflict or custom functions
- 3Server misconfiguration (PHP version, memory limits)
- 4Incorrect .htaccess rules or mod_rewrite issues
- 5Missing or corrupted core files
- 6CORS or SSL certificate problems
How to Fix
Step-by-Step Solutions
- Disable all plugins
Run a command or go to the Plugins page and deactivate every plugin. Then test the REST API. If it works, reactivate plugins one at a time to find the offender.
wp plugin deactivate --all - Switch to a default theme
Activate a default theme to rule out theme issues. If the API works, the problem lies in your theme’s code.
wp theme activate twentytwentyone - Check .htaccess rules
Open the .htaccess file in the root directory and ensure it contains the standard WordPress rewrite rules. Remove any custom rules that might block /wp-json/ endpoints.
- Verify PHP settings
Make sure the PHP version is 7.4 or higher and memory_limit is at least 256M. Adjust settings in php.ini or via hosting control panel.
- Enable debugging
Add WP_DEBUG=true to wp-config.php to capture detailed error messages. Look for fatal errors or warnings in the logs.
wp config set WP_DEBUG true --raw - Review server logs
Check Apache/Nginx error logs for 500 or 403 responses related to REST API calls. This can pinpoint server-level blocks or misconfigurations.
Commands You Can Try
Technical Details
Related Errors
Still stuck?
Pro tips
- Use the Health Check & Troubleshooting plugin to isolate issues
- Install Query Monitor to see API request details
- Keep WordPress core, themes, and plugins updated
If the REST API still fails after following these steps, contact your hosting provider for server‑level support or reach out to WordPress.org support forums for further assistance.
If these solutions didn't help, try searching our database for similar issues.
Contact Support