You’ve probably heard of 404 status codes when a page is not found, but what about 204 status codes?
We’re fond of 204s, and not just because it’s one of our area codes—they’re a huge, often overlooked, part of how you and your clients use the internet daily. Let’s break down the 204 status code, helping you understand what it is, when it’s trouble, and how it can affect SEO.
Understanding HTTP Status Codes
HTTP status codes are three-digit codes that provide information about the communications between your browser and a server; more specifically, they are a server’s response to a browser’s request. There are several types of status codes, including:
1xx codes: Informational responses to a request
2xx codes: Success
3xx codes: Redirections
4xx codes: Website (client) errors
5xx codes: Server errors
Understanding HTTP status codes can help you improve your site’s structure, catch errors early, and tell search engines which pages you want them to index. Every HTTP status code you see gives you some information about how a client and server are interacting. The 204 status code is important but isn’t discussed nearly enough; we’re here to correct that.
What Is a 204 Status Code?
All 2xx status codes indicate some kind of success, and the 204 status code is no exception. Technically, the 204 status code means a request has been successfully completed, but no response payload body will be present.
The response body carries the data intended for the client; the client is most typically your web browser but could also be an API client, an app, or other software. In layperson’s terms, a 204 status code most often means a request was completed, but no HTML, CSS, JavaScript, or other code was transmitted.
What Causes a 204 Status Code To Be Displayed?
204 status codes are a core part of how servers and clients interact. You can expect a 204 status code whenever a request to the server has been successfully processed, but there’s no need for the server to send any data in the response body. This generally occurs when:
- The client makes an API call
- The client makes AJAX requests—form submissions, actions that trigger background processes, certain API calls, and much more
Even more technically, 204 status codes are an HTTP response to a POST request, PUT request, DELETE request, GET request, or certain other HTTP operations. The response occurs when no message body needs to be returned.
Common Reasons for 204 Status Codes
There are several possible reasons for a 204 status code, including:
- Form submissions that don’t require a refresh
- Deletion operations, including the deletion of some users accounts or database records
- Update requests (like updating a user profile) that don’t require feedback
- API actions without the need for a content response
204 status codes are often received during software development, especially when developers are using Distributed Version Control Systems (DVCS) like Git. Most DVCS repository hosts provide web APIs so users can interact with the DVCS, creating, modifying, and deleting files in their repository. DVCS hosts expect automated data transfers to occur repeatedly; as such, they expect a lot of 204 status codes to be generated.
204 Status Misconfigurations and Other Issues
In an ideal world, all of the 204 status codes generated by your website will indicate some kind of success; your users will submit forms or make API calls where no response is needed, and your server will let their clients know.
Unfortunately, your site may return a 204 status code when it should be providing content or taking some other action. This can occur for many reasons, including:
- Server-side scripting errors
- Configuration errors
- HTTP header manipulation
- HTTP header corruption
- Unexpected behaviour from frameworks or libraries
- And more
Not sure what any of this means? Don’t worry—you can get a web developer to help. The takeaway here is simply that sometimes, your website will return a 204 status code when it should be returning other status codes (generally a 200 status code) and that the issue needs to be addressed if it pops up.
How To Handle 204 Status Codes
As we’ve discussed, 204 status codes aren’t inherently bad—they usually mean that something is working exactly the way you want it to. You’ll only encounter problems with a 204 status code if it’s appearing when it shouldn’t be.
Finding 204 Status Codes
The best way to find every 204 status code on your site is to use Screaming Frog. Screaming Frog crawls your site and can report back every HTTP status code it encounters, including all 2xx status codes.
Your goal when finding every 204 status code on your site is simple: You want to check whether or not pages on your site are reporting a 204 status code when they should be reporting a different status code.
Realistically, this can be a very tedious process, especially if you’re not adept at coding. We don’t recommend checking up on status codes everyday—this is a process you should undertake if users are reporting problems. Generally, this occurs when users are expecting content to be served up but are getting 204 status codes instead.
Remember—your users won’t know what a 204 status code is, so your reports are unlikely to clearly tell you what to look for. This is, in essence, a troubleshooting step for when users report missing content.
Correct Misconfigurations and Errors
Once you’ve found areas on your website delivering 204 response codes instead of the appropriate response code (usually 200), you’ll need to correct whatever is causing the misconfiguration or error.
How to do so goes beyond the scope of this article; it depends on what is causing the wrong response code to appear. This step may go beyond your abilities; you should talk to your web developer or try troubleshooting by contacting the provider of any forms, widgets, or other interfaces causing the HTML status code configuration error.
Occasionally, a 204 status code may be delivered by an indexable page on which no content was found. These can turn up in Google Search Console as 404 errors. Be sure to use the noindex meta tag in order to prevent this issue on those pages; as a reminder, this tag is: <meta name=”robots” content=”noindex”>.
Conclusion
HTTP 204 status codes rarely have a profound or direct effect on the SEO of your website—they’re certainly a lot less remarkable than 404s or redirects. Nonetheless, it’s critical to understand how they affect user experience, especially if they’re occurring where they shouldn’t be or if Google is indexing pages with no content.
SEO Audit
Jacob Kettner is the owner and CEO of First Rank Inc., a digital marketing agency based in Winnipeg, Manitoba. He currently sits on Manitoba Chamber of Commerce Small Business Advisor Council which assists people grow their small businesses in Manitoba.