How to Fix the 400 Bad Request Error in WordPress

|
how to fix 400 bad requst error wordpress

If you’re a WordPress website owner, then you’ve probably come across the 400 series of error messages. 400 Bad Request errors can be one of the most irritating aspects of owning a WordPress website – whether you’re new to the platform or not.

This common WordPress error code may not be very descriptive, but if it’s an HTTP 4xx code, that means the issue is on your end. Typically it has to do with your browser, computer or phone (whatever device you’re using to access the website).

While there are many potential causes for this error, we’ll walk through some basic solutions that should get your website up and running again. Let’s take an in-depth look at what causes the 400 Bad Request error in WordPress and how we can fix it.

What is the 400 Bad Request Error?

400 error screenshot

The error code 400 Bad Request displayed on your screen (also known as just “400” or “HTTP 400 error”) means that the request you sent to access a website has malfunctioned. This error code occurs when the data stream between you and the web server is interrupted while trying to view or load a webpage.

The 400 Bad Request error is, in short, a generic client error that happens when the web server doesn’t understand the request.

To better understand this concept, try imagining if you sent a letter to somebody without putting an address or any form of identifier on it; The person receiving it would have no idea where it came from or who it’s for. That’s what the 400 Bad Request is – your browser didn’t include enough information so the server didn’t know what to do with your specific request.

Causes of 400 Bad Request Errors

The 400 Bad Request error can have numerous causes at heart, and while this error isn’t exclusive to any particular browser or operating systems, the solutions can differ slightly.

Incorrect Links/URL 

The HTTP error 400 can show up when you or somebody on a website is trying to get into an invalid URL. This happens because of illegal characters being put into the requested URL string or a malformed link.

An illegal character is any symbol that doesn’t appear often in URLs, while a ‘malformed’ URL can occur when an extra % (percentage sign) is placed in the incorrect URL string.

In some cases, a website user may send false request routing information using URL by accident. To process requests securely and ensure that the user is not attempting anything illegal, certain web servers are developed to search for special HTTP headers. If an expected custom HTTP header is missing or malformed, it will cause problems.

Browser Cache Issue

When you visit a website, your browser copies and stores some of the data from that site on your computer. This is called caching, and it’s helpful because it makes loading times faster when you revisit a page. However, too much cached data can lead to server errors like the 400 bad request error.

If the URL is accurate but you’re still getting a 400 Bad Request error, it might be because of damaged files in your web browser cache or outdated/corrupted browser cookies.

DNS Cache Issue

The 400 Bad Request error pops up when the DNS data on your computer is out of sync with what’s registered on DNS servers.

Every domain name is an alias for a unique IP address. You can think of an IP address like a phone number that “calls” the specific server you want to connect to. The first time you visit any website, a process called “name resolution” occurs and this is when domains resolve to their IP addresses.

Instead of having to perform a name resolution process for each and every website visit, these details can be stored locally on your computer in the DNS cache. This works similarly to how the browser cache stores HTML, CSS, JavaScript, media, and other files.

File Size Too Big

A frequent error that returns an HTTP 400 code is uploading a file – such as an image, video, or text document – to your WordPress site that is too big. The size limit varies depending on the server’s configuration or what is normally considered an acceptable file size.

If you’re experiencing this issue, it’s because your web server can’t handle the request and is resulting in an error code. As a result, you won’t be able to access your web page or content.

Different types of 400 Bad Request Errors

402 Payment Required

The HTTP 402 Payment Required is a nonstandard response status code that has not been assigned to any specific meaning yet. It was created to enable digital cash or (micro) payment systems and would be shown if the client tries to access content they have not paid for yet.

402 Error

403 Forbidden

If you’re receiving a 403 Forbidden error, that means your server is still running but you may not have permission to view some or all of your website. The two primary causes for this error are issues with either your WordPress site’s file permissions or its .htaccess file.

403 Forbidden error

404 Not Found

The 404 error is a message sent by a server in response to a user’s request for a file or page that cannot be found. The hosting server automatically sends the user an error message, “404 Not Found”, when this occurs.

404 Not found Error

408 Request Timeout

The 408 request timeout error occurs when a client sends a request to the server, but the server doesn’t receive it within the allocated time. In other words, the client is taking too long to establish a secure connection.

408 timeout

How to fix the 400 Bad Request Error in WordPress

Refresh the Page

Usually, the first thing we do when a website fails to load is hit refresh. A forced refresh tells your browser to bypass any cached copies of the page and request a new copy from the server.

Clearing your cache can often fix many common issues, including 400 Bad Request errors.

You can try one of these commands depending on your browser:

  • Chrome on Windows: Ctrl + F5
  • Chrome on Mac: Command + Shift + R
  • Firefox on Windows: Ctrl + F5
  • Firefox on Mac: Command + Shift + R
  • Safari: Command + Option + R
  • Microsoft Edge: Ctrl + F5

Check the URL

When typing a URL into the browser, it is easy to mistakenly add extra characters.

In this example, a % symbol has been mistakenly typed, causing the 400 error screen to appear:

bad url

The domain name and page you’re trying to access might be misspelled, so check for errors. They should also be separated by forward slashes. If the particular URL includes special characters, double-check that they’ve been encoded correctly and are legal URL characters.

If you have long URLs, an online URL encoder/decoder will make your life much easier. These types of utilities can also automatically detect illegal characters in the URL.

With the correct characters used in the browser URL, your page ideally loads correctly:

good url

If the URL is still not working and you get the same error, then you need to clear your browser’s cache.

Clear Browser Cache and Cookies

If the files stored on your computer for a particular website have become corrupted, it can cause a 400 Bad Request error.

To fix this, you need to go to your browser’s history and delete all cookies and cache. Different browsers have different ways of doing this, but you need to make sure that the entire history is removed – otherwise, data stored from other websites may have corrupted files too.

You must clear your cache and cookies regularly to ensure optimal performance for your browser. The process differs between browsers, but here we will show you how to do it for Google Chrome. With the settings option open, click on the three dots icon from the top right corner of your screen:

clear browser cache chrome

To do this, open the Google Chrome settings page and go to the Privacy and Security tab. There, you will find the Clear Browser Data button:

clear browser cache 2

Click on the “Clear Browser Data” option. A window will pop up. Select the “Cookies and other site data” and “Cached images and files” options. Click on the “Clear data” button to delete your website cache and cookies:

clear browser cache 3

You could remove all the browser cookies at a different time, but it’s more efficient to do it now. However, this will also delete other saved data that provides a better internet browsing experience.

If the 400 Bad Request error is no longer present after completing one or both of these steps, then the problem has been solved. If the error persists, continue with troubleshooting.

Clear DNS Cache

Although both DNS cache and browser cache improve website loading speeds by saving relevant data, they are not the same thing. Your system saves DNS cache, while the browser saves browser cache.

If you can’t fix the http 400 server in WordPress by clearing your browser cache, try flushing the local DNS cache instead.

You can clear your DNS cache on a Windows OS by opening Command Prompt and navigating to Windows Systems > Command Prompt:

windows command prompt

Enter the following line into the command line interface:

ipconfig /flushdns

After you run this command, it should return a confirmation that the DNS cache has been successfully flushed.

DNS cache flush confirmation

You can then close the Command Prompt window.

Deactivate Browser Extensions

The 400 Bad Request error on your browser could be caused by newly installed extensions. It might also be due to a plugin or theme interrupting your service requests. To see if the issue gets resolved, disable or deactivate these tools from your browser or server.

Reduce Uploaded File Size

If you’re receiving an HTTP 400 bad request error when uploading a file to a website or server, this fix is likely relevant for you. The reason being is that the file you’re trying to upload is too large. There’s usually a set limit on individual file size when it comes to WordPress websites and servers.

upload file size

If you’re uploading excessively large images, audio or video files to a website, it’ll likely exceed the file size limit. If you’re hosting your own website, your web host probably has set a file size limit.

The way to test this is easy. Take a smaller file and attempt to upload in the same manner onto the website.

If successful, then you’re more than likely reaching the maximum limit for filesize and receiving HTTP error 400.

Conclusion

If you ever come across a “400 Bad Request” error on your WordPress website, don’t panic. These errors are more common than you might think and there are easy ways to fix them. In most cases, all it takes is clearing your browser’s cache or reloading the page. However, if the problem persists, it could be an indication of a more serious issue with your website.

If you need help troubleshooting or maintaining your WordPress website, our team of experts can provide the assistance you need to keep your site running smoothly.

Even if you aren’t a Pronto client, you can leverage our Emergency WordPress Support services. Our team will quickly and efficiently address the problems your website is experiencing for a one-time fee – no subscription required!

Contact us today to learn more about our services and how we can help you achieve your online goals!

YOU MIGHT ALSO LIKE

Persona Targeting for Industrial Companies

  • This field is for validation purposes and should be left unchanged.

How SEO Works for Industrial Companies

  • This field is for validation purposes and should be left unchanged.

How to Measure ROI from Industrial Marketing Efforts​

  • This field is for validation purposes and should be left unchanged.

Download PDF

"*" indicates required fields

Name*
Request
This field is for validation purposes and should be left unchanged.