WordPress Errors 8 min read

How to Fix WordPress REST API 404 Error and Site Health cURL 28 Timeout

Advertisement

Google AdSense In-Article Display Placement

Publisher ID: ca-pub-XXXXXXXXXXXXXXXX (Configured in config.php)

The WordPress Block Editor (Gutenberg) and modern plugins rely heavily on the REST API endpoint (/wp-json/). If Apache fails to rewrite URLs or a security plugin blocks API requests, Site Health throws a 404 or cURL 28 error.

✔ Rapid Direct Solution

1) Go to WP-Admin -> Settings -> Permalinks and simply click "Save Changes" (this flushes and regenerates .htaccess rewrite rules). 2) Verify that Apache mod_rewrite is enabled on your host. 3) Test "https://yourdomain.com/wp-json/" in your browser; it should return a JSON response.

1. Problem Diagnosis & Symptoms

Publishing posts fails with "Updating failed. The response is not a valid JSON response" when REST API routes cannot be resolved.

2. Primary Root Causes

  • Cause: Missing or corrupt .htaccess rewrite rules.
  • Cause: Security plugin blocking /wp-json/ endpoints.

3. Step-by-Step Diagnostic Fixes

1

Flush Permalinks in Admin Dashboard

Navigate to Settings -> Permalinks and click Save Changes without modifying anything.

4. How to Verify the Resolution

  • ✔ Open https://yourdomain.com/wp-json/ in a new tab; confirm JSON output appears.

5. Diagnostic Troubleshooting Matrix

Symptom Observed Root Cause Recommended Action
wp-json returns 404 Not Found Apache mod_rewrite not processing rewrite rules Check .htaccess file permissions and verify AllowOverride All in Apache

6. Critical Mistakes to Avoid

  • ❌ Never set permalinks to Plain (?p=123) if plugins rely on clean REST routes.

7. Frequently Asked Questions

❓ Does Cloudflare block the WordPress REST API?

Cloudflare WAF Bot Fight Mode can occasionally flag legitimate REST API requests from administrative AJAX calls.

Official Technical References

Advertisement

Google AdSense In-Article Matched Content Unit