admin-ajax.php 400 Error: Why Actions Silently Fail (2026)
Disclosure: some links on this page are affiliate links. We may earn a commission at no extra cost to you. How we test and rate hosts.
You open DevTools because something silently fails - a form won't submit, autosave stalls, a button spins forever. The Network tab shows admin-ajax.php returning 400, or responding with a bare "0". This is WordPress's universal AJAX endpoint failing, and the fix depends on which failure mode you're seeing.
First: Decode the Failure Mode
- Response "0": the request reached WordPress but no action hook caught it - missing action param, dead nonce, or the handler isn't registered for your login state
- HTTP 400: the request was malformed or rejected before the handler ran - often a security layer
- HTTP 403: a firewall blocked it - check the 403 guide and WAF logs
- HTTP 500: the handler fatals - see the 500 guide and enable WP_DEBUG_LOG
Fix 1: The Stale Nonce (Most Common)
If the error appeared after enabling page caching, this is it. The page was cached with a nonce from an old session; the AJAX call validates the nonce and dies. Exclude logged-in users from cache and exclude admin-ajax.php itself. Clear the cache and retest - solved in most cases.
Fix 2: Identify the Failing Action
In DevTools, click the failing request → Payload/Form data → find action. Its value names the plugin's hook (e.g., wpcf7_submit = Contact Form 7). That tells you exactly which plugin owns the broken AJAX. Deactivate/reinstall it, or check its settings for a REST/AJAX toggle.
Fix 3: Firewall and Security Rules
Wordfence, Sucuri, iThemes, Cloudflare WAF and mod_security all inspect AJAX bodies. A form submission containing HTML, URLs, or serialized data can trip a rule. Check your firewall's block log for entries hitting admin-ajax.php and whitelist the specific action or the logged-in path. Also check your CDN isn't POST-blocking - Cloudflare "Bot Fight Mode" is a frequent offender.
Fix 4: Works Logged-In, Fails Logged-Out
Classic missing wp_ajax_nopriv_ hook - the developer only registered the handler for authenticated users. If it's your code, add the nopriv hook. If it's a plugin, that's a bug: report it or find an alternative. Confirm quickly by testing the action in an incognito window.
Fix 5: Plugin Conflict Sweep
If nothing above fits, do the binary search: rename wp-content/plugins to plugins_off, retest the failing action, then reactivate in halves until it breaks. It's the same isolation method used for the wp-admin blank screen - crude but definitive.
Keep Reading
- Invalid JSON response - the Gutenberg/REST sibling of this error
- WordPress 403 forbidden - firewall blocks in depth
- 429 too many requests - if admin-ajax is being rate-limited
- Critical error fix - when the handler fatals
- Bluehost review 2026
- WordPress 'Cannot Modify Header Information - Headers Already Sent' Fix (2026)
- WordPress Theme Broken After Update: Layout Destroyed (2026)
- Locked Out: Too Many Failed Login Attempts (2026)
- Increase the WordPress Maximum Upload File Size (2026)
What are you building?
Tell us about your project so we can match the perfect hosting plan.
Hosting Cost Calculator
See exactly how much you'll spend on hosting over time. Compare Bluehost vs popular alternatives and discover your potential savings.
Used to calculate transaction fees (Shopify charges 2% on sales)
Frequently Asked Questions
What does a 400 on admin-ajax.php actually mean?
admin-ajax.php received a request it couldn't route - usually a missing or malformed 'action' parameter, a dead nonce, or a security layer stripping the request. A response of '0' means the request arrived but no registered handler accepted it. A 400/403 means something blocked it before WordPress could run the callback.
What's the most common cause?
A stale nonce. WordPress nonces expire (default 12-24h) and page caches serve old nonce values to new sessions. If the error started after enabling a caching plugin, exclude logged-in users and admin-ajax.php from caching.
Can a security plugin or firewall cause this?
Yes - Wordfence, iThemes, Cloudflare WAF rules, and mod_security frequently flag AJAX payloads as suspicious (they often contain serialized data or HTML). Check the firewall log for blocked admin-ajax.php requests and whitelist the action.
Why does it only break for logged-out users?
The plugin registered only the wp_ajax_ hook, not wp_ajax_nopriv_. Logged-in users work; visitors get 0. That's a plugin bug - report it or fix by adding the nopriv hook.
How do I find which plugin is failing?
In DevTools Network tab, click the failing request and inspect the 'action' parameter - it names the plugin's handler (e.g., 'myplugin_save'). Deactivate that plugin, or if the action is missing entirely, the plugin providing it is deactivated or fatals before registering the hook.
Ready to launch?
Get Bluehost from $3.99/month with a free domain, free SSL, and 30-day money-back guarantee.
Related Articles
Bluehost vs Competitors: The Technical Deep Dive
We ran 47 benchmarks over 90 days. Here's the raw data on why Bluehost dominates.
Fix ERR_TOO_MANY_REDIRECTS in WordPress (2026): The 6 Real Causes
ERR_TOO_MANY_REDIRECTS means an infinite redirect loop. Match your Site URLs, fix Cloudflare SSL mode, reset .htaccess, kill plugin conflicts - step-by-step with code.
WordPress 403 Forbidden Error: 7 Fixes That Actually Work (2026)
403 means the server understood you but refuses to serve the page. Fix file permissions (755/644), regenerate .htaccess, kill security plugin blocks - in the right order.
Fix 502 Bad Gateway in WordPress (2026): Diagnose First, Then Fix
502 means the gateway got a bad response from your server - usually PHP timeouts, CDN issues, or overload. A 9-step diagnostic workflow from browser checks to server logs.
Fatal Error: Maximum Execution Time Exceeded - 6 Fixes (2026)
max_execution_time kills slow updates at 30-60s. Fix the culprit plugin/theme first, then raise the limit via wp-config, .htaccess or php.ini - with exact code.
HTTP Error Uploading Images in WordPress: 9 Fixes Ranked (2026)
The vague 'HTTP error' on image upload usually means memory limits or Imagick. Fix order: rename the file, bump memory, force GD library, check permissions - with code.