Contents
With a 400, the server stops at the request before it even looks for the page: something in the URL, headers, cookies or body doesn’t match what it expects. That puts it among the client errors (4xx) in the HTTP status codes, and it is usually fixed on the browser side or in the code that sent the request.
Depending on the server, the message may read 400 Bad Request, Request Header Or Cookie Too Large, or Your browser sent a request that this server could not understand.
What causes a 400 error
- Corrupted or oversized cookies: some plugins and apps write so many cookies that the request headers exceed what the server accepts.
- A malformed URL: illegal characters, a
%not followed by a valid code, or unencoded spaces. - Invalid API data: broken JSON, a missing required field, or a
Content-Typeheader that doesn’t match the body. - WordPress
admin-ajax.phpcalls with no registeredaction; WordPress answers with a 400 and the body0. - A browser extension that rewrites requests or headers, such as some privacy tools.
- Stale browser cache after the site was changed or moved to a new server.
Fixing it as a visitor
- Check the URL and remove anything odd after the
?, then try again. - Open the site in a private (Incognito) window. If it works there, cookies or extensions are the cause.
- Clear cookies for this site only: click the padlock next to the address, open site settings, and delete its data.
- Temporarily disable extensions, especially ad blockers and privacy tools.
- If the error appears on every browser and device, the problem is on the site, so let the owner know.
Fixing it as the site owner
- Reproduce the request with
curlto see the full response and headers:
curl -i "https://example.com/page?id=10"
- Check the logs: in cPanel open Metrics → Errors for recent server errors, and Metrics → Raw Access to see which URLs return 400 and who requests them.
- Read the response body from your API: frameworks like Laravel, Express and FastAPI usually name the invalid field there. Make sure you send the right header:
curl -i -X POST https://example.com/api/orders \
-H "Content-Type: application/json" \
-d '{"product_id": 15, "qty": 1}'
- Cut down cookies: if you see
Cookie Too Large, find the plugin or code writing large cookies and keep that data in a server-side session instead. - In WordPress: if the 400 comes from
admin-ajax.phpor REST routes, disable plugins one at a time to find the one sending incomplete requests. See also WordPress REST API errors. - Encode URLs in your code before sending them, with
encodeURIComponent()in JavaScript orurlencode()in PHP.
If the URL itself is extremely long, you may get 414 URI Too Long instead.
Prevention
- Keep cookies few and small; don’t store large data in them.
- Validate input in the front end before sending, and return a clear error message instead of an empty response.
- Test your API endpoints after each release, especially when the request format changes.
On ArabyHost
Your site runs on LiteSpeed, which reads .htaccess just like Apache, and the error log is in cPanel, one click away from the Araby Panel. You can also ask the Araby AI assistant to read the error log and explain the cause and the fix. If a valid request is being rejected by a security rule, support can review the ModSecurity or Imunify360 block for you.
FAQ
Is a 400 error my fault or the website's?
Usually the request itself is the problem: a broken cookie, a mistyped URL or invalid data from an app. It can also be the site's code if it rejects requests that are actually valid.
Why do I get a 400 error on only one website?
Cookies are stored per site. If that site's cookies are corrupted or too large, only that site fails. Clearing that one site's data in your browser usually fixes it.
What's the difference between 400 and 404?
A 400 means the request was invalid, so the server never processed it. A 404 means the request was fine but the page doesn't exist on the server.