Your website’s performance and user experience depends on using correct HTTP status codes, redirects and error pages. In this guide, you will learn step by step how you can address these issues on a WordPress-based site.
What are Status Codes?
Status codes are numerical values that indicate the operating status of a program or process. Status codes are used in many different contexts, such as programs, processes, or HTTP requests. Status codes are used to indicate that an operation completed successfully, an error occurred, or some other status.
For example, in the HTTP protocol, status codes are used to indicate whether web servers successfully processed a request or if an error occurred. Status code 200 represents “OK” (successful) status, status code 404 represents “Not Found” status.
Additionally, many programming languages and systems have error codes or status codes that are used to determine the success of operations. For example, certain error codes can be used in a language to identify errors that occur while reading a file.
In general, status codes are used to understand the outcome of a process or a situation in the system and act accordingly.
What are Status Codes?
1xx Information States
100 Continue The client can continue sending data to the server.
101 Switching Protocols The server accepted the protocol change request.
2xx Success Cases
200 OK: The request was processed successfully.
201 Created A new resource has been created successfully.
204 No Content The request was processed successfully, but there is no content in the response.
3xx Redirect Status
301 Moved Permanently The resource has been moved permanently, the new URI should be used.
302 Found (or Moved Temporarily) Resource has been moved temporarily, new URI should be used.
304 Not Modified The resource exists in the client’s cache and has not been updated.
4xx Client Error Conditions
400 Bad Request The request was not understood correctly or is not appropriate.
401 Unauthorized Authentication failed or credentials are missing.
403 Forbidden Request denied, no authorization.
404 Not Found The requested resource was not found.
5xx Server Error Conditions
500 Internal Server Error A general error occurred on the server side.
502 Bad Gateway The server did not receive a valid response.
503 Service Unavailable The server is currently unavailable.
Error pages are often created based on these status codes. For example, a page for a 404 error might contain the message “Page not found.” Server response codes are used to notify the client of the server’s processing results and are based on status codes.
Error Codes and Solution Suggestions
Status codes are used to determine whether a transaction or request completed successfully, an error occurred, or some other status. In particular, status codes in the HTTP protocol are important for informing whether web servers are successfully processing requests or if an error occurred. In this guide, you will focus on common status codes and error pages and learn step by step how to handle them on a WordPress-based website. This way, you can provide your users with a more consistent experience and optimize your website’s performance.
3xx HTTP Status Codes
3xx HTTP status codes generally indicate redirect operations. Here are some common 3xx error codes and solutions:
301 Moved Permanently
Problem: The relevant page has been permanently moved to another location.
Solution: Check the destination of the redirect, set the new address of the page correctly and update it.
302 Found (Temporary Redirect)
Problem: The relevant page has been temporarily moved to another location.
Solution: Check the destination of the redirect and set the new address of the page correctly.
303 See Other
Problem: The relevant page is located in a different place, it redirects to another page.
Solution: Check why the redirect was made and edit the new address of the page if necessary.
307 Temporary Redirect
Problem: The relevant page has been temporarily moved to another location.
Solution: Check the destination of the redirect and set the new address of the page correctly.
308 Permanent Redirect
Problem: The relevant page has been permanently moved to another location.
Solution: Check the destination of the redirect, the new address of the page Set and update the ini correctly.
4xx HTTP Status Codes
400 Bad Request
Problem: You wanted to go to the desired page, but something went wrong.
Solution: Make sure you typed the address of the page correctly. If it is misspelled, write it correctly.
401 Unauthorized
Problem: You do not have permission to access the page.
Solution: Get permission from the owner of the page or provide the required password or information for the page.
403 Forbidden
Problem: You do not have permission to access the page.
Solution: Contact the page owner or obtain the necessary permissions for the page.
404 Not Found
Problem: The relevant page was not found.
Solution: Check the link of the page, if the page has been removed, add a new link or redirect.
408 Request Timeout
Problem: The request could not be completed within a certain time.
Solution: Increase the request time or contact your hosting provider to improve the speed of the server.
410 Gone
Problem: The page no longer exists.
Solution: Show users a message that the page is down and provide alternative content if necessary.
429 Too Many Requests
Problem: You sent too many requests and the server is limiting you.
Solution: Request less frequently or contact your hosting provider to increase the server’s limits.
5xx HTTP Status Codes
500 Internal Server Error
Problem: A general error occurred on the server.
Solution: Contact your hosting provider. It is their responsibility to review and fix server errors.
502 Bad Gateway
Problem: The server received an error while communicating with another server.
Solution: Contact your hosting provider. They may need to check and correct server communication.
503 Service Unavailable
Problem: The server is temporarily out of service.
Solution: Contact your hosting provider. It usually occurs during server maintenance or high traffic situations.
504 Gateway Timeout
Problem: The server could not receive a response from another server within a certain period of time.
Solution: Contact your hosting provider. They may need to check server gateways and extend the time if necessary.
508 Loop Detected
Problem: The server is stuck in a loop.
Solution: Contact your hosting provider. They may need to prevent a loop on the server configuration.
In this guide, we have examined step by step solutions to HTTP status codes and error pages you may encounter on a WordPress-based website. We focused on common error codes in the 3xx, 4xx and 5xx categories. We’ve covered a variety of situations, from routing issues to user errors to server errors. These solution suggestions can help to improve the performance of your website and also provide a better experience to users. This guide provides website administrators and developers with practical information on HTTP status codes and error pages.