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 wp-json
API.
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 wp-config.php
file.
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:
- Fix blank or white screen in WordPress
- OPTIONS / RTSP/1.0″ – Apache Access Log Entry
- Stripe Alternatives in Pakistan – 2022 Update
- Block Editor: Pattern vs. Variation vs. Style vs. Transformation
- How Dynamic Content Rendering via Edge Workers Impact SEO
- eCommerce Business on Shopify vs. WordPress. Which is better?
- SafePay – Payment Gateway in Pakistan
- Take back your business name used by someone on Social Media
- Impact of Google BARD AI on Search Traffic to Websites
- TTFB: Time to First Byte – What it is, high TTFB causes, and fixes