How to Enable WordPress REST API?
Tips
WPTR Team
January 1, 2025
How to Check if It's Open?
Simply add /wp-json/ to the end of your site URL (e.g., example.com/wp-json/). If you see a JSON data response, it's open. If you see a 403 or 404 error, it's closed.
Common Reasons for Access Issues
- Security Plugins: Plugins like Wordfence, iThemes Security, or All In One WP Security may block REST API access for non-logged-in users.
- Disable REST API Plugins: You might have installed a plugin specifically to disable this feature.
- Firewall (WAF): Server-level firewalls (Cloudflare, ModSecurity) might block automated requests.
How to Enable It?
- Check Security Plugins: Review the settings of your security plugins. Look for options like 'Disable REST API' or 'Block Anonymous REST API' and disable them.
- Disable Specific Plugins: If you have plugins like 'Disable REST API', deactivate them.
- Check Permalinks: Sometimes simply going to Settings > Permalinks and clicking 'Save Changes' can fix API 404 errors.
apisecurityguide