HTTP status codes are returned every time a user or a search engine attempts to visit a web page. They indicate whether a page can be successfully viewed, or if any issues are preventing it from being accessed.
They are an important part of SEO and should be understood in order to give your website the best chance of performing well in the search engines. This article acts as a guide to HTTP status codes and what you need to know from an SEO perspective.
A HyperText Transfer Protocol (HTTP) status code is a response message sent by the web server when a user or search engine attempts to visit a web page. The three-digit code indicates whether a request made by the web browser can or cannot be fulfilled.
The following process outlines how a browser displays a web page to a website visitor, to help you understand the role of the HTTP status code:
The steps above show how a website page is loaded if everything is fine with the requested content and server. However, if there is an issue, then step 4 would be different. The server would send back a HTTP status code indicating that there is an error. For example, a 404 code indicates that the requested page cannot be found, and an error page will be displayed to the user.
It is important to monitor the HTTP codes that are being returned for your website, and address any issues, as these could affect the site’s indexing or search engine rankings.
Although there are many possible HTTP status codes that can be returned by the server, they can all be categorised into 5 different classes.
The first digit of the 3-digit HTTP response code will start with one of five numbers, 1 to 5, which indicate different types of responses:
There is a long list of possible status codes, but some are particularly important to understand for SEO. The following is a breakdown of these most important HTTP status codes for SEO.
This is the response code that you and your site users will want to be returned. A client asks the server for a web page, the server responds with a 200 success message, and the requested web page is loaded successfully.
Everyone arrives successfully at Page A.
This is used when a URL has been moved permanently to a new location. When the client requests the old web page, the server will process a redirect and return the web page at its new location.
301 redirects are often required when managing a website. For example, if an old page is unpublished from the site, and no 301 redirect is set up, then a 404 error page will be presented to the user. Using a 301 redirect will instead send the user to a different page than the one requested, passing on any of the link value of the old page to the new page.
Everyone is redirected to the new page - page B.
This means that the requested destination has been found, but has been moved to a different location. The client requests a web page, the server finds this page but is instructed to redirect the user to a different location.
A 302 redirect should only be used as a temporary redirect. If you plan to use the original URL again in future, then you can temporarily redirect from this URL to a new URL. Unlike a 301 redirect, no link value will be transferred to the new URL using a 302 redirect as search engines will view this as a temporary redirection.
Visitor and search engine bot are redirected to page B, link juice is left behind.
The 307 status code is a replacement for 302 in HTTP1.1. It is used to temporarily redirect URLs to new URLs, when the original URL is to be used again in future.
For more help on which type of redirect you should be using, read our guide to redirects.
A user who does not have authorisation to access certain content, will receive a 403 code from the server. The content will be forbidden to anyone without the correct log in credentials.
A 404 is returned when the server does not find anything matching the requested URL. It is usually due to that page being removed from the site.
You should avoid sending users to a 404 error page where possible. When you remove a page, make sure you set up a redirect from the deleted page to a page that has related content. It is important to monitor your site for 404 errors, and keep these to a minimum.
Requested page is gone. Visitors see a 404 page.
A 410 status code provides the same result as a 404 as the requested content is not found on the server. The difference being, a 410 tells the search engines that the page has been deleted, and to essentially remove it from their index.
This should be considered permanent, and any links pointing to the page should be removed. Before permanently deleting a page from your site in this way, you should first consider whether there is a similar equivalent page that you can redirect to instead.
A 451 HTTP status code indicates that a requested page has been removed due to legal reasons. A takedown request or orders from a judge to delete certain content are cases in which this status code should be used, informing search engines of the reason it can’t be accessed.
This is a general error indicating that the server was prevented from carrying out a request due to encountering an unexpected issue. It doesn’t provide specifics on what caused the error. It could be a problem with your web host, or a script not working correctly on your site for instance. The issue would have to be looked into to discover the cause.
Everyone is lost.
A 503 status code indicates the server is temporarily unable to carry out the request due to overloading or server outage. For example, if the server is undergoing maintenance for a short period of time, a 503 should be used. This tells search engines that the site is only down temporarily, and to come back again later.
Everyone is asked to try again later.
HTTP status codes are something that SEOs encounter and have to deal with on a regular basis. It is vital to understand what the difference between the status codes is and how best to approach them from an SEO perspective.
Below, we’ve outlined some best practices when it comes to HTTP status codes and SEO.
When it comes to redirecting a site or specific pages, 301 redirects are recommended in most cases. This type of redirect tells the search engine that a page has moved permanently to a new location, and passes on the link value from the old page to the new.
302 or 307 redirects should only be used when a redirect is to be considered temporary by the search engine, and the old URL will be used again in the future. These redirects do not pass on link value from the old page to the new location, as the new page is only deemed a temporary stand-in for the original page.
If you need to delete a page from your website that has good external links pointing to it, or receives decent traffic, then you should set up a 301 redirect from this URL to another relevant URL on the site. Otherwise you’ll end up losing the SEO value and traffic associated with that page.
However, pages that don’t receive traffic, have no links pointing to them, or don’t provide value to a user, are sometimes best left to return a 404. This will help prevent them from being indexed and crawled by search engines. Be certain to make sure any internal links to the page are removed, otherwise they will continue to be found and crawled by search engines.
Some SEOs believe it is best to 301 redirect every page that returns a 404 error to the homepage of the site. In most cases this is not a good idea as users trying to access the original page will be confused when they are presented with the homepage of the site instead. It is best in some cases for users to realise that the original page no longer exists.
A custom 404 error page can be a useful tool for ensuring users don’t leave your site even though they have not been able to access the page they were originally looking for.
A good 404 page should include:
HTTP status codes are something that SEOs will encounter and need to monitor on a daily basis. You should be familiar with the different codes and what they mean in terms of SEO performance if you wish to optimise your site for search engines.