Back to blog

How to Fix WordPress admin-ajax.php 400 Bad Request Error

Yuhda Ibrahim

Development Consultant

October 14, 2025

4 min read

Introduction

If you’ve been working on your WordPress site and suddenly run into the dreaded admin-ajax.php 400 Bad Request error, you’re not alone. This error can pop up when you least expect it—while updating plugins, tweaking your theme, or even when visitors are interacting with certain features on your site. For many site owners, it’s a head-scratcher because the message is vague, yet it can seriously disrupt functionality.

The good news? Fixing this error is usually easier than it looks. The admin-ajax.php file plays a crucial role in handling background requests in WordPress—things like form submissions, WooCommerce cart updates, and plugin features. When a 400 Bad Request appears, it means something is blocking or miscommunicating with that file.

How to Fix WordPress admin-ajax.php 400 Bad Request Error

In this guide, we’ll walk you through why this error happens, the most common causes, and step-by-step solutions to get your site working again. Don’t worry—you don’t need to be a developer to follow along.


What Is the admin-ajax.php 400 Bad Request Error?

Before fixing the issue, it helps to understand what’s going on.

  • admin-ajax.php is a core WordPress file located in the /wp-admin/ folder.
  • It processes AJAX requests that allow your site to update parts of a page without reloading.
  • A 400 Bad Request means your server rejected the request because it was malformed or invalid.

In simple terms: your site tried to ask WordPress for something, but the server didn’t like the way it asked.


Common Causes of admin-ajax.php 400 Bad Request Error

There isn’t just one cause. Here are the most frequent culprits:

  • Plugin conflicts – especially if multiple plugins rely on AJAX.
  • Theme issues – poorly coded themes can interfere with requests.
  • Corrupted cookies or cache – stored browser data can confuse requests.
  • Security plugins or firewalls – sometimes they mistakenly block AJAX requests.
  • Server configuration problems – issues with .htaccess, PHP limits, or hosting setup.
  • Incorrect URLs – hardcoded or outdated AJAX URLs in scripts.

Clear Browser Cache and Cookies

One of the simplest fixes is to clear your browser cache and cookies. Cached data or old cookies may cause invalid requests.

  • Clear cache and cookies from your browser settings.
  • Open your site in Incognito/Private Mode to check if the error disappears.

If the issue only happens in one browser, this might be all you need.


Disable Plugins to Find Conflicts

Plugins are often the number one reason for AJAX-related errors.

Here’s how to check:

  1. Go to WordPress Dashboard → Plugins → Installed Plugins.
  2. Temporarily deactivate all plugins.
  3. Check if the error goes away.
  4. Reactivate plugins one by one until the error returns.

Once you identify the problematic plugin, you can:

  • Update it to the latest version.
  • Contact the developer for support.
  • Look for an alternative plugin if no fix is available.

Switch to a Default Theme

Themes can also cause AJAX errors, especially if they use custom scripts.

  • Switch temporarily to a default WordPress theme like Twenty Twenty-Four.
  • Check if the error persists.

If it disappears, your theme is the culprit. You may need to update it or reach out to the theme developer.


Check Your .htaccess File

Sometimes the .htaccess file becomes corrupted or contains incorrect rules that block AJAX requests.

To fix this:

  1. Connect to your site via FTP or File Manager in hosting.
  2. Locate the .htaccess file in the root directory.
  3. Rename it to .htaccess_backup.
  4. Go to your WordPress Dashboard → Settings → Permalinks and click Save Changes.

This generates a fresh .htaccess file. If the error is gone, your old file was the issue.


Increase PHP Limits

If your server resources are too low, large AJAX requests may fail with a 400 error. You can increase limits by editing your php.ini or .htaccess:

php_value max_input_vars 5000
php_value post_max_size 64M
php_value upload_max_filesize 64M
php_value memory_limit 256M

If you’re not comfortable editing server files, ask your hosting provider to help.


Whitelist AJAX in Security Plugins or Firewall

Some security tools block admin-ajax.php by mistake. If you’re using plugins like Wordfence, Sucuri, or a firewall service like Cloudflare, check their settings:

  • Whitelist or allow admin-ajax.php.
  • Temporarily disable the firewall to see if it’s the cause.

If the error vanishes, adjust the firewall rules accordingly.


Check AJAX URL in Your Code

If you’ve customized your theme or plugins, make sure the AJAX URL is correctly set. It should point to:

/wp-admin/admin-ajax.php

Hardcoding the wrong URL (like using HTTP instead of HTTPS, or an old domain) can cause requests to fail.


Contact Your Hosting Provider

If none of the above fixes work, the problem might be on the server side. Hosting providers sometimes configure security rules that block AJAX requests. Reach out to support and explain that admin-ajax.php is returning a 400 error—they can check logs and adjust settings.


Conclusion

Running into the WordPress admin-ajax.php 400 Bad Request error can feel overwhelming, but most of the time the fix is straightforward. Start with simple steps like clearing your cache, disabling conflicting plugins, or switching themes. If that doesn’t work, review your .htaccess, increase PHP limits, and check firewall settings.

By following these troubleshooting steps, you’ll not only fix the error but also improve your site’s stability and performance. If all else fails, don’t hesitate to ask your hosting provider for help—they’ll often spot server-level issues quickly.

A smooth, error-free site keeps your visitors happy, so taking a little time now will pay off in the long run.

Contact Us

Need WordPress Support For your website?

We fix Every Issue of Your WordPress Website.

Our office:

Pandeglang, Indonesia

Upwork

Yuhda Ibrahim

Link

Email us:

support@wpsupportwebdevelopment.com

Link