When a page on your site, or your entire website, is unreachable due to HTTP error codes, it can be quite frustrating. Beyond causing general annoyance, it can also contribute to higher bounce rates and poor User Experience (UX).
Fortunately, you can fix many of the most common HTTP error codes for WordPress users without advanced techniques. It just takes a little investigative work to determine the cause of the issue, then some troubleshooting.
In this post, we’ll discuss the most common HTTP error codes, why they happen, and how to diagnose and fix them. Let’s get started!
An Introduction to HTTP Error Codes
When a browser makes a request, the server issues corresponding ‘status codes’. Each has a different meaning, but you can use them to help narrow down the reason why your page isn’t loading properly.
All Hypertext Transfer Protocol (HTTP) response status codes fall into one of five categories:
- 1xx: Status codes in the 100s are informational response codes and mean the server received the browser’s request and is processing it.
- 2xx: Codes in this category indicate that the server successfully understood, received, and accepted the request.
- 3xx: HTTP status codes in the 300s are redirection codes and signal that further action is needed.
- 4xx: This family of HTTP status codes refers to a client (or browser) error and communicates that the request contains bad syntax or that the server otherwise cannot fulfill it.
- 5xx: Status codes in the 500s are internal server errors and occur when the server is unable to fulfill a seemingly valid request.
In this article, we’re going to focus on the last two categories. More specifically, we’ll dive into the 400, 401, 403, 404, and 500 responses, as these are the HTTP error codes you’re most likely to come across.
How to Fix the Most Common WordPress HTTP Error Codes (5 Key Solutions)
Before you attempt any of the following solutions, it’s wise to back up your site. There’s always a chance something could go wrong, so it’s important to have a recent version to restore to avoid breaking it even further.
Once you’ve backed up your site, you’ll be ready to take a look at fixing the HTTP error you’re experiencing. Below are five of the most common issues, why they happen, and what you can do to resolve them.
400 Bad Request
This generic message occurs when the server is unable to fulfill the request, but the reason doesn’t fall into any of the other error code categories. There are multiple reasons why this might happen, although most often it means that there’s invalid syntax within the HTTP request:
Common triggers for a 400 Bad Request error include:
- An incorrectly typed URL
- Outdated browser cache, cookies, or DNS cache
- A file that exceeds the maximum upload size for the site
After checking to make sure you’re using the correct URL, try accessing the site from a different browser. If it works, you can likely narrow it down to a problem with your stored data.
After that, the next step is to clear your browser cookies and cache. The process will vary slightly depending on the browser you’re using.
In Google Chrome, you can accomplish this by clicking on the menu icon in the top right corner, then selecting More tools > Clear browsing data:
You might also try uploading a smaller file if you believe that is what’s causing the 400 Bad Request error. Finally, if none of these solutions work, there might be an issue with your DNS cache. You’ll need to clear it to resolve the problem.
A 401 Unauthorized error means the server requires authentication to fulfill the request. However, the process has either failed or the correct credentials have not been provided:
One of the most common causes of this error is a poorly configured WordPress plugin. More specifically, a security plugin might be mistaking your login attempt for a brute-force attack.
To determine if this is the problem, you can deactivate all your WordPress plugins. If you have access to your dashboard, you can do this on the Plugins page by selecting Deactivate from the Bulk Actions dropdown:
If not, you can log into your hosting account’s File Manager or initiate File Transfer Protocol (FTP) with an FTP client such as FileZilla. Then, rename your plugins folder (located in the wp-content directory) to plugins-disabled:
Save your changes and reload your page. If it works, try re-activating your plugins individually until you find the one causing the issue.
Some other solutions include clearing your browser cache and cookies. You may also want to try logging out and back in again.
The 403 Forbidden error code in WordPress is usually shown when server permissions are limiting access to a particular page on your site. It is commonly accompanied by the message, “You don’t have permission to access’/’ on this server”:
While it’s similar to the 401 Unauthorized code, a 403 status indicates the credentials provided were valid. However, the server is still refusing access.
This might be due to an incompatible security plugin, which we covered in the last section. However, another common cause is incorrect file permissions. Refer to our WP Engine tutorial on how to reset file permissions to resolve a 403 Forbidden error in WordPress.
404 Page Not Found
A 404 ‘Page Not Found’ status is one of the most common error messages seen on the web. Usually, this happens when only one page on your site is inaccessible, but the rest work properly:
Broken links or changed URLs are popular causes of this status code. If you made any such changes to your site recently, you may want to check your links to ensure they’re still functional.
Alternatively, your .htaccess file deals with the hyperlink structure of your WordPress site. To resolve a 404 error, you may need to edit it to reconfigure your permalink settings.
One way to do this is by generating a new .htaccess file. The easiest method for this is to simply resave your permalink settings in WordPress. From your admin dashboard, navigate to Settings > Permalinks and click on Save Changes:
Then try reloading your site to see if this resolves the 404 Not Found message.
500 Internal Server Error
Another common WordPress issue you might encounter is the 500 Internal Server Error. The upside to this status code is that you can narrow it down to a server-side issue. However, it can also be frustratingly vague:
Sometimes, you might not even receive an error message, but simply a blank white screen. Two common causes of an internal server error message are:
- A problem with your .htaccess file
- Your site has reached its memory limit
Your .htaccess file is essentially how your WordPress site communicates with its server. As you might recall from the previous section, it can sometimes override and mess with your permalink settings. Therefore, the first step is to check whether it has become corrupted by disabling it.
You can do this by locating the .htaccess file in the root directory on your server (under public_html) via your hosting account File Manager or FTP. Then, rename it to something along the lines of .htaccess-disabled:
Once you save your changes, try revisiting your WordPress site. If it loads successfully, you just need to generate a new .htaccess file. You can do this by saving your permalink settings as described above.
If this does not work, the problem may be that you’ve reached your site’s PHP memory limit. To increase it, you can try adding the following snippet to your wp-config.php file:
You can also change the limit to 128MB or 256MB. Save your changes and reload your WordPress site. If this doesn’t work, you may need to reach out to your hosting provider to upgrade your plan or determine if there is a different server-level issue.
WordPress is a powerful, reliable platform for your website. Unfortunately, between corrupted files and outdated caches, there’s always a risk users’ browsers and your server might have trouble communicating, resulting in a WordPress error.
In this article, we discussed five of the most common HTTP error codes, why they happen, and how you can fix them for your WordPress site:
- 400 Bad Request. Triggered by a request with invalid syntax, sometimes simply checking the URL for typos or clearing your browser cache can resolve it.
- 401 Unauthorized. Often attributed to a poorly configured security plugin, you can sometimes fix this error by deactivating all your plugins to determine which is causing the problem.
- 403 Forbidden. This happens if a page or resource is intentionally restricted. However, if your site’s file permissions are incorrect, you’ll need to reset them.
- 404 Page Not Found. This error is usually caused by misconfigured permalink settings and can be resolved by rewriting the permalink rules via your WordPress settings.
- 500 Internal Server Error. To fix an internal server error, you might need to generate a new .htaccess file. Alternatively, it may require increasing your PHP memory limit.
Do you have any questions about fixing common WordPress HTTP error codes? Let us know in the comments section below!
The post How to Fix the Most Common WordPress HTTP Error Codes appeared first on Torque.