The “bad request” error means that the server got a request from the client, but can’t process it because there seems to be a problem with it. To put it another way, your browser, program, or script sent something that the website or server couldn’t understand. A faulty URL, corrupted cookies, invalid data in a request body, headers that are too big, or some other technical problem with how a request was made can all cause this.
You will study the following in this guide:
- What does “400 Bad Request” mean?
- the most common reasons
- How to repair it as a guest
- How to fix it if you’re a site owner or developer
What does “400 Bad Request” mean?
What does “400 Bad Request” mean with relation to cookies, nginx, APIs, or WordPress? The HTTP status code 400 Bad Request means that there was a problem on the client’s end. The server couldn’t handle the request because it was so awful, thus the response was turned down. A momentary problem with a server might fix itself quickly, but 400 errors usually mean that the request needs to be changed in order for it to work. You could notice some differences:
- 400 Bad Request
- Error 400 in HTTP
- HTTP Status 400: Bad Request
- HTTP/1.1 400 Bad Request
- Error 400: Bad Request
- 400 Bad Request: The request header or cookie is too big.
All of these lead to the same main problem: the server didn’t like the request.
What does “400 Bad Request” mean in simple terms?
If you want to know what it means in plain English:
The site is responding, “I got your request, but it’s not right.”
That “something wrong” could be:
- a mistake in the URL
- a query string that doesn’t work
- awful cookies
- form data that isn’t valid
- an upload that the server won’t accept
- a request header that is too big
- A request to an API has bad JSON.
When individuals look for the meaning of “400 bad request,” they usually want to discover one thing:
Is the problem with my computer or the website?
The response is that the request is usually the problem, but that doesn’t indicate the user did it on purpose. A browser extension, plugin, or site setting might sometimes make the improper request happen on its own.
Quick diagnosis: What type of 400 error are you getting?
This short guide can help you figure out what the problem is.
If this happens
- Only on one website
- After logging in or while accessing your account
- While uploading a file
- In a call to an API
- In the WordPress admin-ajax.php file
- On websites that use Nginx
Most likely reason
- faulty cookies, cached site data, or a problem with the URL
- session problem, cookie too big
- limit on request size, file that isn’t valid, poor form input
- JSON that isn’t formatted correctly, headers that are improper, and arguments that aren’t acceptable
- missing action parameter, incorrect hook, or AJAX setup problem
- The header is too big, the cookie size is wrong, or the request structure is wrong.
This is why a good article about how to fix a 400 incorrect request shouldn’t just give one general answer. It depends on the situation what the fix is.
The most common reasons for a 400 Bad Request
There are various reasons why a 400 error can happen, however the ones below are the most typical.
1. The URL is wrong.
One of the easiest reasons is a terrible URL.
These are some examples:
- putting the wrong address in
- with characters that aren’t valid
- putting in a broken link
- adding a query string that isn’t right
- utilizing a URL that is old or not full
Adding only one more symbol to the address can make the request invalid.
2. Cookies are either broken or too big.
Cookies keep information about your session and the site in your browser. The server might not accept the request if those cookies get broken or too big.
This happens a lot when:
- you stay logged in for a long period
- A site has too much session data saved.
- more than one tracking or plugin cookie is inserted
- The mistake only happens on one website.
This typically looks like:
400 Bad Request: The request header or cookie is too big.
3. The headers for the request are too big.
Headers have extra information that comes with the request, like cookies, browser information, auth tokens, and other metadata.
Some servers give a 400 error when headers get too big.
This happens more often on sites that use reverse proxies, authentication levels, or custom app installations.
4. The request body or form has data that isn’t valid.
The server might not accept your form, file, or JSON sent to an API if the input is not legitimate.
For example:
- badly constructed JSON
- not enough fields filled out
- file formats that aren’t supported
- terrible coding
- characters that aren’t valid
- faulty request formatting
5. The cache in the browser is old.
Your browser may still be sending old cached data or cookies, even after the website has changed.
Even if the site is running perfectly for everyone else, this can cause a 400 error.
6. Browser add-ons get in the way of the request.
Ad blockers, privacy extensions, script blockers, or security extensions can change requests in a way that makes things go wrong.
This is worth investigating if the problem goes away in Incognito mode or another browser.
7. Problems with DNS or the local browser
The browser may save old site data, or there may be a problem with the local network that is causing wrong queries.
This doesn’t happen very often, but it can happen.
8. Issues with applications or plugins
Plugins, themes, programs, or scripts may make erroneous requests behind the scenes on dynamic websites.
This happens a lot with:
- Requests for WordPress AJAX
- systems for logging in
- ways of payment
- JavaScript programs made just for you
- Integrations with third parties
How to fix 400 Bad Request as a guest
If you’re a regular person trying to open a webpage, do these things first.
1. Look at the URL very carefully
Check to make sure the address is right.
Check for:
- mistakes in spelling
- areas that weren’t meant to be there
- two slashes
- parameters that are broken
- odd symbols at the end of the URL
If you clicked a link from another site, you might want to go to the homepage first and then find your way around.
2. Reload the page
If you get a transient failed request because of old data or an unfinished request, a quick refresh might cure it.
Give it a shot:
- update regularly
- hard refresh
- opening the tab again
3. Clear cookies for that site
This is one of the greatest ways to fix the problem if it only happens on one site.
Remove:
- cookies on the site
- storage on the site
- data that has been cached for that domain
If you need to, open the website again and log in again.
This works best for:
- loops for logging in
- issues with the session
- Errors that say “request header or cookie too large”
4. Clear the cache in your browser
If there are old files or data in the cache, clearing it can assist.
Try the page again after clearing the cache.
5. Try using Incognito mode
Incognito mode turns off a lot of saved browser features, which can help you quickly figure out if the problem is caused by:
- Cookies
- extra parts
- session data that is stored in memory
If the site works in Incognito mode, the problem is probably with your usual browser session.
6. Turn off browser add-ons
Extensions can change requests without you knowing it.
Turn off for a while:
- blocks for ads
- tools for privacy
- script injectors
- add-ons for security in your browser
After that, refresh the page.
7. Use a different browser or device
This is a quick approach to see if the problem is just with your browser.
The problem is most likely with your current browser settings and not the website itself if it works OK on other sites.
8. If you’re uploading something, make the file smaller.
If the error happens when uploading, try:
- utilizing a file that is smaller
- modifying the format of the file
- changing the name of the file
- uploading from a different browser
Some 400 problems that occurs when you upload something are because the request is too big or the input doesn’t pass validation.
9. Get in touch with the owner of the website
If you’ve tried everything else and the problem only arises on one site, the owner of that site may need to solve it.
Tell them:
- the URL of the page
- what caused the error to happen
- the browser and device you used
- if it happens in Incognito
- the precise text of the mistake
That helps them fix the problem more quickly.
How to repair the 400 Bad Request error in Chrome
A lot of people look for how to cure 400 bad request on Chrome.
This is the quickest list of things to do in Chrome:
Step 1: Get rid of cookies for the site that is having problems.
Open Chrome settings and delete cookies that are only for that domain.
Step 2: Get rid of files and photos that are saved in your cache.
Old cached material can keep making requests that are no longer valid.
Step 3: Go to the page in Incognito mode
If it works there, the fault is probably with cookies, the cache, or an extension.
Step 4: Turn off extensions
Turn off each extension one at a time, especially those that protect your privacy or block ads.
Step 5: Update Chrome
Sometimes, an old browser can make it hard to handle requests.
Step 6: If you need to, try a different network.
Sometimes, a security filter or network layer can get in the way of requests.
For Chrome users, the most important fix is still the same: first, delete the cookies and cached data from the site that is having problems.
400 Bad Request: The request header or cookie is too big.
This is a very common special situation.
The request headers, especially cookies, are frequently too big for the server to handle.
This happens a lot when
- A site keeps too much session data.
- a lot of plugins install cookies
- Authentication mechanisms make cookies that are too big.
- Tracking scripts add extra cookie values to the pile.
- Users log in and out of the system many times over time.
What to do when you’re a visitor
First, try these fixes:
- remove cookies for that website
- Sign in again
- Try it out in Incognito mode.
- try a different browser
- Use a different device.
What you should do as the owner of a site
If a lot of people notice this, the fault could be with the server or the app.
Look for:
- big session cookies
- copied cookie values
- plugins that add extra cookie data
- restrictions on reverse proxy
- Settings for the Nginx header buffer
This keyword needs its own help article since it has a specific way to fix problems.
400 Bad Request in APIs
If you’re a developer or work with APIs, a 400 error usually signifies that the server didn’t accept the request body or parameters.
Some common causes are:
- JSON that isn’t right
- Content-Type is incorrect
- missing needed parameters
- query strings that aren’t valid
- schema for bad requests
- wrong encoding
- incorrect format for auth
- values in the field are not valid
A list of things to examine when debugging an API
- check the JSON body
- Make sure that all needed fields are there.
- look at the headers
- check the Content-Type
- go over the query parameters
- Check your request against the API documentation.
- Look at the whole request in Postman, the browser’s developer tools, or the logs.
When the server gets a 400 error linked to an API, it usually sends back a response body that tells you which field failed. Always check that message first.
Nginx: 400 Bad Request
A 400 error on a Nginx site can happen because of bad requests, problems with headers, or cookie size constraints.
You can find searches like:
- 400 bad request nginx
- nginx 400: Bad Request
- 400 failed request: the request header or cookie is too big for nginx.
look into these situations:
- size of the request header
- expansion of cookies
- headers for authentication
- How a reverse proxy works
- application logic making values too big
just raise limitations on the server without finding out what’s really wrong. If cookies get too big because of bad session handling or plugin behavior, that should be fixed as well.
400 Bad Request for WordPress and admin-ajax.php
WordPress is another key case.
A lot of people look for:
- admin-ajax.php 400 bad request: action not found
- WordPress admin-ajax.php 400 bad request: action not found
- WordPress admin-ajax.php is lacking an action, which is a 400 bad request.
This commonly happens when a WordPress AJAX request doesn’t have all the data it needs or the action isn’t set up correctly.
Some common explanations are:
- missing action parameter
- wrong AJAX URL
- The action in JavaScript and the hook in PHP don’t match up.
- hook only works for users who are logged in
- hook not there for users who are not logged in
- plugin or theme problem
Because the solution is more technical than the main 400 instructions, this too needs its own help article.
400, 401, 403, 404, and 422
A lot of the time, people mix up 400 with other HTTP failures. This is the real difference.
Bad Request 400
The request is either not valid or not well-formed.
401 Not Allowed
Authentication is needed or it didn’t work.
403 Not Allowed
The server understood the request but won’t let you in.
404 Not Found
There is no page or resource that you asked for.
422 Content That Can’t Be Processed
The format of the request is correct, but the substance is not.
Knowing the difference helps you not waste time on the wrong remedy.
For instance:
- 400 is a common error code for incorrect JSON.
- 401 may happen if you don’t log in.
- 403 errors can happen because of permission problems.
- 404 means that the pages are missing.
- 422 may happen because of validation flaws.
Is the 400 Bad Request error your fault or the website’s?
This is a question that comes up a lot.
The best answer is:
It can be either, but most of the time it signifies that the request is not valid.
That request could originate from:
- your web browser
- your cookies
- your saved session
- an add-on for your browser
- JavaScript that the website uses
- a faulty request from a server-side app or plugin
Even though 400 is a client-side error, the real problem could still be with the site’s configuration or development.
Site operators should follow these best practices to avoid 400 Bad Request issues.
These strategies will help you cut down on 400 errors if you run a website.
Make cookies tiny
Don’t put info that isn’t needed or is too big in cookies.
Check inputs and URLs
that forms, query parameters, and request bodies are all valid.
login and session flows
A lot of 400 problems appear when you log in or after many sessions.
Look over the restrictions for the proxy and server.
Make sure that the settings for Nginx, the app server, the CDN, and the security layer are all correct.
Keep track of bad requests
Good logging makes it much easier to find out what’s wrong with 400 errors.
Be careful when testing AJAX and API endpoints.
Check the needed arguments, action names, request methods, and how authentication works.
Get rid of extra plugins
Too many plugins on WordPress and other similar sites might cause cookies to be duplicated, AJAX requests to fail, or URLs to be misconfigured.
Last thoughts
The server couldn’t accept the request because something about it was wrong, which is why you got a 400 Bad Request error.
The quickest remedies for frequent users are:
- Look at the URL
- delete cookies
- empty cache
- Try Incognito
- turn off extensions
- Try again with a different browser.
The underlying reasons are frequently deeper for site owners and developers:
- URLs that are not right
- big cookies or headers
- bodies of bad requests
- limitations on uploads
- Problems with Nginx settings
- Mistakes in setting up WordPress AJAX
You won’t find the underlying cause if you approach every 400 error the same way. The best way to go about it is to first figure out what the problem is and then address it.
FAQ
What does it indicate when you get a 400 Bad Request?
The server turned down the request because it was invalid, malformed, or not clear enough.
What do I do to fix 400 Bad Request?
Check the URL first, then clear your cookies and cache, attempt Incognito mode, turn off plugins, and test another browser.
Why does one website keep giving me a 400 Bad Request error?
That usually means that the cookies are broken, the cached site data is bad, or there is a problem with the site itself.
What does it signify when the request header or cookie is too big?
It signifies that the request headers, which often include cookies, are bigger than what the server can handle.
Is the server having a problem with 400 Bad Request?
Not all the time, but sometimes. The server is refusing the request, but the real problem could be with the browser, faulty cookies, incorrect input, or the way the site is set up.
How to repair the 400 Bad Request error in Chrome?
Clear the cache, cookies, and history for the site that is having problems. Then try Incognito mode, turn off extensions, and upgrade Chrome.
What does it mean when WordPress admin-ajax.php gives a 400 Bad Request?
Usually, this happens when the AJAX request doesn’t have the right action parameter, the wrong AJAX URL, or the wrong WordPress hook.