Back to Home
WordPress REST API Error: Troubleshooting Guide
wordpress-error

REST API Error

WordPress REST API Error: Troubleshooting Guide

29 views
Updated February 28, 2026

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

  • 1
    Plugin conflict or buggy code
  • 2
    Theme conflict or custom functions
  • 3
    Server misconfiguration (PHP version, memory limits)
  • 4
    Incorrect .htaccess rules or mod_rewrite issues
  • 5
    Missing or corrupted core files
  • 6
    CORS or SSL certificate problems

How to Fix

    Step-by-Step Solutions

    1. 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
    2. 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
    3. 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.

    4. 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.

    5. 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
    6. 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

    wp plugin deactivate --all
    wp theme activate twentytwentyone
    wp core check-update
    wp config set WP_DEBUG true --raw

    Technical Details

    Error TypeRuntime
    SeverityMedium
    Platformwordpress-error
    App VersionAll

    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