Fixed: WordPress wp-json 500 Server Error
Fix HTTP 500 Server errors for /wp-json/ or WP API requests on Wordpress on any shared hosting or cloud hosting.
In adherence to our rigorous editorial policy, this article's content has undergone careful testing for accuracy and trustworthiness and hence, this content is marked source of information. View editorial history of this content.
Recently on one of our testing WordPress website on Digital Ocean encountered 500 errors in Gutenberg for
Fix # 1: Increase Memory Limit
After troubleshooting, we found that our server memory size was not enough.
By default, the Digital Ocean App Platform build-pack allocates 128 MB of RAM per PHP request. We increased the memory limit to 512MB and the
/wp-json/ 500 error was resolved.
To increase WP memory limit, add
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); to your WordPress
Depending upon your traffic (internal and visitors), running scripts or plugins, and theme complexity, availability of excess RAM, you might want to increase it to 1024MB or more.
If you’ve WP installed on your droplet via Digital Ocean’s marketplace image, you can locate your
wp-config.php file at /var/www/html folder. Follow this guide to edit or update WP files on Digital Ocean without SSH client.
Fix # 2: Don’t leave basic post fields blank
Ensure that you’re not leaving basic post fields empty. While reproducing this error, we found another issue in our case. We left the post content field blank and same issue appeared again. We filled the content field, updated or saved the post, and the 500 error was resolved.
The basic post fields includes title and post content.
Digital Setups has enforced a strict sourcing policy. Every content piece published on our website is passed through strict editorial review for contextual correctness, communication ethics, and programmatic tests wherever required. Our team research solutions from only credible, authentic, and trustworthy sources. Learn more about our editorial process.
Based on our editorial policy, we update our content time to time to ensure its usefulness, reliability, and validity.
Our standardized editorial process ensures right, timely, and usefulness updates to our content. Your honest opinion drives significant improvement to our content. We appreciate you are taking time to share that.
Readers who read this also found these helpful:
- SafePay – Payment Gateway in Pakistan
- wp_list_users_args Hook – Explanation & Usage Example
- Why my site webpages are not indexing properly in search results?
- How to Register Trademark in Pakistan: For SMCs, Entrepreneurs, & Freelancers
- Misleading or Clickbait Push Notification Hurts SEO
- Impact of Google BARD AI on Search Traffic to Websites
- For Pakistanis: Still Effective Work from Home Ideas (No Tiktoking)
- What is trademark infringement in digital business?
- Unlock new cross-device capabilities & More with Google Signals
- Keyword Density in SEO