HTTP Status Code and SEO


What are HTTP status codes?

HTTP status codes are three-digit responses that a server returns at the request of a client (a browser or search engine). There are five classes of status codes, and each class conveys a different type of message.

HTTP stands for Hypertext Transfer Protocol. It’s the protocol used by clients and servers to communicate and exchange data. HTTP status codes are part of the communication process.

To fully understand these codes, you have to know how a browser gets a web page. Every website visit starts by typing in the URL of a site or entering a search term in a search engine. The browser sends a request to the site’s IP address to get the associated web page. The server responds with a status code embedded in the HTTP header, telling the browser the result of the request. When everything is fine, an HTTP 200 header code is sent back to the browser, in conjunction with the content of the website.

However, it is also possible that there’s something wrong with the requested content or server. It could be that the page is not found, which gives back a 404 error page, or there might be a temporary, technical issue with the server, resulting in a 500 Internal Server Error. These HTTP status codes are an important tool to evaluate the health of the site and its server. If a site regularly sends improper HTTP header codes to a search engine indexing its contents, it might cause problems that will hurt its rankings.

The different types of HTTP statuses

There are five different ranges of HTTP status codes, defining different aspects of the transaction process between the client and the server. Below you’ll find the five ranges and its main goal:

  • 1xx – Informational
  • 2xx – Success
  • 3xx – Redirection
  • 4xx – Client error
  • 5xx – Server error

Most important HTTP status codes for SEO

As we’ve said, the list of codes is long, but there are a couple that are especially important for SEOs and anyone working on their own site. We’ll do a quick rundown of these below:

200: OK / Success

This is how it probably should be; a client asks the server for content and the server replies with a 200 success message and the content the client needs. Both the server and the client are happy — and the visitor, of course. All messages in 2xx mean some sort of success.

301: Moved Permanently

A 301 HTTP header is used when the requested URL permanently moved to a new location. As you are working on your site, you will often use this, because you regularly need to make a 301 redirect to direct an old URL to a new one. If you don’t, users will see a 404 error page if they try to open the old URL and that’s not something you want. Using a 301 will make sure that the link value of the old URL transfers to the new URL.

302: Found

A 302 means that the target destination has been found, but it lives under a different location. However, it is a rather ambiguous status code, because it doesn’t tell if this is a temporary situation or not. Use a 302 redirect only if you want to temporarily redirect a URL to a different source and you are sure that you will use the same URL again. Since you tell search engines that the URL will be used again, none of the link value is transferred over to the new URL, so you shouldn’t use a 302 when moving your domain or making big changes to your site structure, for instance.

307: Temporary Redirect

The 307 code replaces the 302 in HTTP1.1 and could be seen as the only ‘true’ redirect. You can use a 307 redirect if you need to temporarily redirect a URL to a new one while keeping the original request method intact. A 307 looks a lot like a 302, except that it tells specifically that the URL has a temporary new location. The request can change over time, so the client has to keep using the original URL when making new requests.

403: Forbidden

A 403 tells the browser that the requested content is forbidden for the user. If they don’t have the correct credentials to log in, this content stays forbidden for that user.

404: Not Found

As one of the most visible status codes, the 404 HTTP header code is also one of the most important ones. When a server returns a 404 error, you know that the content has not been found and is probably deleted. Try not to bother visitors with these messages, so fix these errors as soon as possible. Use a redirect to send visitors from the old URL to a new article or page that has related content.

Monitor these 404 messages in Google Search Console at Crawl errors and try to keep them to the lowest amount possible. A lot of 404 errors might be seen by Google as a sign of bad maintenance. Which in return might influence your overall rankings. If your page is broken and in fact should be gone from your site, a 410 sends a clearer signal to Google.

410: Gone

The result from a 410 status code is the same as a 404 since the content has not been found. However, with a 410 you tell search engines that you deleted the requested content, thus it’s much more specific than a 404. In a way, you order search engines to remove the URL from the index. Before you permanently delete something from your site, ask yourself if there is an equivalent of the page somewhere. If so, make a redirect, if not maybe you shouldn’t delete it and just improve it.

451: Unavailable for Legal Reasons

A rather new addition, the 451 HTTP status code shows that the requested content has been deleted because of legal reasons. If you received a takedown request or a judge ordered you to take specific content offline, you should use this code to tell search engines what happened to the page.

500: Internal Server Error

A 500 error is a generic error message saying that the server encountered an unexpected condition that prevented it from fulfilling the request, without getting specific on what caused it. These errors could come from anywhere, maybe your web host is doing something funny or a script on your site is malfunctioning. Check your server’s logs to see where things go wrong.

503: Service Unavailable

A server sends a 503 error message when it is currently unable to handle the request due to an outage or overload. Use this status code whenever you require temporary downtime, for instance when you are doing maintenance on your site. This way, search engines know they can come back later to find your site in working order again.

Working with HTTP status codes

HTTP status codes play a fundamental role in quickly getting a message across between clients and servers. It’s important for every SEO to know the most common ones by heart, as it makes them much more effective in their work: it lets them diagnose issues significantly faster.

Here’s the list of the most common HTTP status codes of all:

  • 200 OK
  • 301 Moved permanently
  • 302 Found / Moved temporarily
  • 404 Not Found
  • 410 Gone
  • 503 Service Unavailable