Have you ever experienced the 400 Bad Request error while browsing the internet? Or when you are editing your website, suddenly the 400 Bad Request error appears? Don’t worry, you’ve come to the right place!
In this article, we will discuss in full about 400 Bad Request. Starting from what 400 Bad Request is, the causes, and of course how to solve it.
Table of Contents
What is 400 Bad Request?
The 400 Bad Request error is an error that occurs when the server does not understand requests from website visitors.
This lack of understanding was caused because the request was incorrect or corrupted in the middle of the data transmission process.
400 Bad Request will display a different error on each website. Here we provide a list of the common 400 Bad Request errors:
- 400 Bad Request
- Bad Request. Your browser sent a request that this server could not understand.
- Bad Request – Invalid URL
- HTTP Error 400 – Bad Request
- Bad Request: Error 400
- HTTP Error 400. The request hostname is invalid.
- 400 – Bad request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.
The above list of errors occurs for a number of reasons – which we’ll cover just below. But generally, the problem is on the client-side (website visitors), not on the server-side.
Causes of 400 Bad Request Error on Website
1. Incorrect URL
The 404 Bad Request error can occur because you entered an incorrect URL, has bad syntax, or the URL has unauthorized characters.
Below is an example of a URL with disallowed characters that cannot be processed by the server:
https://son.muhas.ac.tz/?big=400-bad-request/ You can see that the URL above contains the character % which should not be there. When you open the above URL using Google Chrome, an error will appear like this:
2. Corrupt Cache and Cookies
Even though the URL you typed is 100% correct, the 400 Bad Request error can still occur, you know. This is usually because files in your cache and browser cookies are out of date or corrupted.
You may have experienced this when trying to log in to WordPress after not logging in for a long time.
This is because your log-in cookie is corrupt, so it can’t provide admin authentication as usual. Finally, your connection is rejected and a 400 Bad Request error appears.
3. Troubled DNS Cache
The data from the DNS change process is stored locally on your computer in the form of a DNS cache.
Well, the 400 Bad Request error can also occur when the DNS cache data stored locally does not match the DNS on the current website.
It’s possible that the website’s DNS has been updated or changed.
4. File Size Too Large
Another cause of the 400 Bad Request occurs when you upload a file that is too large for the server to process.
Each server has its own limitations, so this 404 Bad Request error varies on each website.
How to Fix 400 Bad Requests Error 
Below, we will explain how to solve the 400 Bad Request. Oh yes, methods number one through four below can be done by visitors or website owners. Whereas method number five is a special solution for website owners only. Good luck!
1. Re-Check Typing URL
The first way you can try is to double-check the URL you just typed in the browser. Even though it sounds trivial, this type is the most common mistake associated with 400 Bad Request, you know.
So, make sure that the domain name and the page you want to access are correct. Check again that the URL is indeed separated by a hyphen ( – ). If the 400 Bad Request error still appears, it’s time for you to try the second method.
2. Clean Your Browser Cache
The 400 Bad Request error can occur if the website files stored by your browser locally are damaged. The files are:
- Text / config file
- Media (picture, video, sound)
- Data files (XML, JSON)
The files above are automatically saved by the browser when you first visit the website.
Because this cache helps the browser work efficiently without the need to download the same file every time you visit the website.
Hence, you need to clear the browser cache to get rid of old corrupted data.
3. Clean Cookies in Your Browser
If clearing browser cache still doesn’t work, you can try clearing browser cookies as well.
One website can use dozens of different cookies. If just one of these cookies expires or is damaged, a 404 Bad Request error will appear.
For example, using Google Chrome, you can delete cookies by clicking the three-dot icon on the top right, then select More Tools> Clear Browsing Data from the pop-up menu that appears.
After that, make sure that you have checked Cookies and other site data and that the Time Range is at All times. If so, just click the blue Clear Data button.
4. Clear DNS Cache
A corrupted DNS cache could also be the cause of the 400 Bad Request error. Therefore, you should delete all DNS ( flush DNS ) records stored on the computer.
Clearing the DNS cache is different for each operating system. But don’t worry, there are many articles which are explained all the methods in their article. You can find a guide on clearing the DNS cache easily.
5. Compress files before uploading to the website (especially for website owners)
As we mentioned above, one of the causes of the 400 Bad Request error is that the file size uploaded to your website is too large.
Some hosts limit the upload file size of each website and sometimes they are not transparent about this.
The solution to this 400 Bad Request is to try uploading a smaller file first. If this works, it means that the previous file was too large and you will need to compress it.
As for video files, you should first upload them to YouTube instead of directly uploading them to the website.
Because, in general, even though it has been compressed, the video size is still larger than the hosting limitation.
Now, after the video is uploaded to YouTube, you can embed the video on the website. How do I embed a YouTube video?
After reading this article, you don’t need to worry when you get the 400 Bad Request error because there are several ways to solve this 400 Bad Request.
The 400 Bad Request error is generally a problem caused on the client-side (the visitor), not from the server-side. So, if you are a website owner, you don’t need to panic about this error.
However, there are times when the 400 Bad Request error occurs on the server side. If you have this, the only way that can be done is to contact your hosting party.
Therefore, make sure that your hosting customer support is always available 24 hours.
This is the article on how to solve the 400 Bad Request error. If you need a guide to solve other website errors – especially on WordPress – we’ve summarized it in a free ebook that you can download below: