How to Fix a 406 Error and Find the Source of the Problem

  • Home
  • SEO
  • How to Fix a 406 Error and Find the Source of the Problem
How to Fix a 406 Error and Find the Source of the Problem
Aug 13, 2021




How to Fix a 406 Error and Find the Source of the Problem

Server and client-side errors happen occasionally, and we commonly refer to them as HTTP responses or status codes. The “406 error” or “406 Not Acceptable” error is one such HTTP response.

You may see the 406 error while visiting a site. Or worse, on your website. While It may irritate the average internet user, it can be borderline terrifying for a website or application owner. Besides looking somewhat unprofessional and confusing, any HTTP response code, including the 406 error, can lose sales and users.

This article will explain the basics of the “406 Not Acceptable” error, its causes, how to fix it, and steps to avoid it in the future.

What Is 406 Error?

The good news is that the HTTP error “406 Not Acceptable” message is not nearly as common as the 404 server error (which usually indicates a non-existent webpage), or even 301 or 500 HTTP errors. Therefore, you definitely shouldn’t see this one as much.

Although it’s rare, it’s still possible that the 406 error may come into play as a problem for your website. It usually looks like this:

One example of a “406 Not Acceptable” message.

The message typically reads:

Not Acceptable

An appropriate representation of the requested resource could not be found on this server.

It then sometimes identifies the “requested resource” where the problem lies, with other messages or server information mentioned at the end:

406 not acceptable message with the blocked resource

Some 406 errors show the rejected resource.

The appearance and text within the 406 error message depending on the website, host, and browser used to access the website. The 406 error may reveal where the errors stem from. Other times you may find that it’s a simple “406 Not Acceptable” error without any information helping you solve the problem.

Now, let’s pretend browsers spoke in plain English and not these cryptic messages. In that case, the browser would be saying something like this:

Hello, I’m a browser. I tried to show this webpage, but one of the two problems occurred:

  1. The website’s server sent me the wrong file format, so I can’t accept it.
  2. The website’s server violates some settings or security requirements.

Therefore, please resolve the violation or have the server use one of the file formats I accept. In case you’re wondering, here are the file formats I know how to read.

If only browsers were that friendly!

Essentially, there’s a miscommunication between the server and the browser or machine used to present the web application. The browser either can’t read what’s coming in or verify the data because it didn’t meet some requirements.

Now we have to answer some questions to figure out the cause of that miscommunication.

Server and client-side errors happen from time to time, but that doesn’t make them any less frustrating 😅 Learn how to fix one common error in this in-depth guide 👇Click to Tweet

What Causes the 406 Error?

Every time you open a web page, your browser (like Safari, Firefox, Brave, Chrome, or Internet Explorer) sends a request to the page’s server to obtain site content and database files. The browser acts as the messenger between you and the server — it tells the server what the user wants to see, and hopefully, the correct information comes back.

During that first request, the browser tells the server all about the file formats it can accept. It’s called an Accept- header request, which prompts the server to deliver the files in the proper formats to produce the entire website or web application, starting with the header.

Sometimes the server sends a reply that’s not in the suitable format or violates a rule set forth by the browser or client machine. In this situation, a 406 error appears in the browser window, indicating the server isn’t delivering the appropriate data.

Here are some examples of “bad formats” and “rule violations” that can come up with the header requests:

  • Accept-ranges: Some servers have security measures set in place or only allow a specific file size range in the response. If the response attempts to send too many bytes outside the allowable range, you’ll see the 406 error.
  • Accept-encoding: Here’s an area of the header meant to compress files, so they move quickly from the server to the browser. Some compression methods and formats aren’t accepted, rendering a 406 error code.
  • Accept-charset: Refers to a character set or how site file tables take code (like CSS and HTML) and turn it into understandable characters. There are so many characters, languages, and symbols in the world that it’s challenging to cover them all. The standard table is called ISO-8859, but there are other complementary tables as well. New character tables occasionally get released to keep up with language and character additions.
  • Accept-language: This is usually a different name for Accept-charset that references its focus on international languages.
  • MIME type violation: Sometimes, the browser requests a specific MIME type from the server. MIME types are content elements like JPEG images, specific video formats, or simple text. If the server can’t provide a requested MIME type, like JPEG images, you’ll see a 406 error.

The primary way to address and fix a 406 error is by checking the source code for issues in the Accept-, Request-, and Response- headers.

The easiest way to review Accept- and Response- headers is to open a webpage in your browser, right-click, and select Inspect.

Go to Network > Headers to reveal all requests from this webpage.

network and header buttons

Right-click and choose Inspect in the browser, then go to the Network and Headers tabs.

You can typically select any request from the long list to see the Request- and Response- headers for that particular request.

finding the response headers for the 406 error

Click on any request in the list to see things like Response- and Request- headers.

Or, you can contact your web developer to take a look into the source code. However, checking the source code is much easier when you have tools for debugging and cleaning your database, which we’ll discuss later in this article.

As mentioned before, a “406 Not Acceptable” error tells us that the client has sent a valid request to the server, but the request included a unique requirement for the server to follow. That special requirement in the initial request was in the form of an HTTP Accept- header.

That leaves us with a few potential causes:

  1. The server didn’t provide the requested MIME type or proper formats, like a JPEG or mp4 video.
  2. The server didn’t return with the correct language (Accept-language). For instance, it may have sent back a response in German when the browser asked for French.
  3. The server used the wrong compression method or format in response to the Accept-encoding request.
  4. The server sent back too many bytes that didn’t align with the Accept-ranges request.
  5. The server failed to provide understandable characters, which would result in a problem with the Accept-charset request from the browser.

There are other reasons you may see the 406 error, but they’re not nearly as common. The above list is from the most common reasons to the least common. The first two come into play far more often than the others, so there’s a good chance you should usually focus on troubleshooting the potential for a MIME type violation or an Accept-language problem.

Overall, website owners should know about these format problems and violations, seeing how something within your site files may cause problems. Such situations often occur because of human error, like accidentally typing in the wrong code, deleting necessary code, or misconfiguring the server. The 406 error also appears when specific security settings or rules block content transmission from the server.

How to Fix the 406 Error

It’s prudent to run a website or application backup before completing any steps to resolve a 406 error. There’s always the potential for causing further problems by going into your site’s source code, so you’ll want to have a database and site file backup to restore if necessary.

Make sure you complete a full backup with everything from the database to the application and the media elements to the site files. If you’re a Kinsta user, you can do this with the MyKinsta backup feature, which logs your entire website in a separate file and has a Restore button for later use:

backups to help with 406 error

Run Daily, Hourly, or Manual backups in the MyKinsta dashboard.

Now that we have a deeper understanding of why the 406 error occurs, it’s time to talk about the best methods to troubleshoot the error and prevent it from happening again.

These tactics include client-side causes (where a user makes an error or the machine isn’t working correctly), server-side causes, and platform-based causes like faulty plugins.

Make Sure the URL Is Correct

Our first piece of advice may sound simple, but it’s the quickest troubleshooting option, and it puts a focus on issues with the client-side of things (i.e., your computer).

A 404 error is far more likely than a 406 error in this situation, but you may end up seeing a “406 Not Acceptable” error if the website URL is valid. Yet, there’s something odd about the way your browser translates the request. For instance, adding “JSON” or “PHP” to the end of URLs could be misinterpreted as a request for those particular formats, even though the client doesn’t need them.

To resolve the issue, double-check the previously used URL that produced the error. Try typing it in again or opting for a different subdomain on the website to see if it’s only one page that isn’t rendering.

A 406 message is technically considered a client-side error code (even though it’s often a platform or server issue), so this is the first course of action to determine if something’s wrong on the client side.

Reset Your Devices and Networks

Another client-side problem occasionally involves those same Accept- headers sent from the user’s computer to a platform that can’t satisfy the request. Many of these platforms include gaming- or media-oriented systems like Hulu or music marketplaces like Spotify.

In simpler terms, you may log into a platform like Hulu, try to watch your favorite TV show, and receive a 406 error message. In this example, the problem is almost always on the client-side. It’s usually your computer, network, or another device you’ve used to launch the platform.

Although it can happen with any platform, some platforms that commonly report 406 errors include:

  • Hulu
  • Google Play
  • Square Enix Games
  • Netflix
  • Xbox
  • Windows (usually for gaming)

This list is far from complete, but it gives you an idea of where the 406 error may occur.

Media and gaming platforms are complicated with many restrictions, and those restrictions depend on your location or network configuration. There’s a chance you might encounter an error like this due to all the moving pieces.

Although we can’t help you troubleshoot every specific platform, consider walking through the following recommendations and checking to see if the error resolves:

  • Go online to check the status of your platform’s server. It may simply be a problem with the company’s server.
  • Restart your computer, gaming system, streaming device, or other machines.
  • Disconnect all devices from their cables, wait a few minutes before reconnecting them all, and check to see if the error is gone.
  • Check if the app is running the most current version. Also, see if any of your machines have firmware updates available.
  • Reset your home or office network (the WiFi or internet connection through your router).
  • Consider switching from a wireless network to a wired network connection if you’re still having trouble.
  • Although this isn’t always a possibility, consider duplicating the error with a completely different machine. Make sure that the device is on the same network. If you can’t replicate the error, look into your network and the original machine.

If all else fails, go to your search engine and type in the name of your platform along with “+ 406 error code” for platform-specific troubleshooting advice. That often reveals forums and support documentation to guide you through the process.

Rollback Your Recent CMS Changes

Next, it’s time to explore the system used for your websites or applications. You may find that your content management system, such as WordPress, is the direct cause of a “406 Not Acceptable” error due to a complication with something inside your site files.

Whether using WordPress or any other content management system, look into when your last update occurred. WordPress has a sturdy default infrastructure meant to avoid these types of errors, no matter what.

However, specific plugins, themes, or manually adjusted coding could produce situations where the site files violate client or server requests. A simple upgrade to your CMS’s latest version can solve the problem right away.

To figure out if it’s your CMS, start by rolling back any recent upgrades that occurred to the core files. As you may already know, WordPress sends out updates to its system regularly. Most of these updates happen automatically, but older versions still require you to click a button.

Furthermore, WordPress and other CMSs utilize several moving parts like plugins, themes, and extensions. Those also get updated regularly, so you might need to roll back some of them.

For all systems outside of WordPress, search for “platform name + how to downgrade.”

If you use WordPress, you can easily downgrade your WordPress website, effectively rolling it back to one of the previous versions:

the wordpress version in the dashboard

Downgrade to a previous WordPress version.

That guide outlines the following methods for downgrading your WordPress site, most of which only take a few minutes:

Uninstall and Reinstall Plugins, Themes, and Extensions

WordPress plugins and themes add extra code to your site files that interact with the core WordPress files. Reputable plugins typically don’t cause any problems, but occasionally a conflict occurs. A plugin, theme, or third-party extension may be the reason for the 406 error.

The tried-and-true method for identifying a troublesome plugin or theme is to deactivate your plugins and themes one by one. After disabling each, check to see if the 406 error has vanished. If so, you’ve found the problem. If it doesn’t go away, reinstall the plugin or theme and continue uninstalling the next one.

deactivate plugins when you see a 406 error

Go to the Plugins tab in WordPress and Deactivate each plugin one by one.

Start with your plugins, then move to the theme. Uninstalling and reinstalling a theme has more significant potential for content rearrangement.

Analyze the Status of Your Database for Changes and Conflicts

Unfortunately, a removed “problem” plugin could still affect your WordPress database since plugins get full access to the database to work well. Therefore, you should still check the status of your database even if it appears the removal of a plugin has made the 406 error go away. Otherwise, you may still run the risk of seeing further issues in the future.

If a plugin or theme wasn’t the culprit, you should also check your database if it’s the primary source of the error. Sometimes a database change, whether accidental or purposeful, becomes the primary reason a 406 error appears.

To scan and fix your database, consider these solutions:

  1. Install a database scanner and cleaner that removes useless and troublesome tables and assets. Some options include WP Optimize and the Advanced Database Cleaner. Much of this process involves deleting old or orphaned items like trash posts, revisions, and metadata. It’s a solid first step to cleaning up your database and potentially eliminating that 406 error.
  2. Scan the database and look for records and tables potentially changed by a problematic plugin or ones that look out of place or unnecessary.
  3. If you have an idea of what’s wrong with your database, go to a search engine and seek out help from forums and other discussions online. There’s a good chance someone else has experienced the same problem.
optimizing database with plugin

Clean your database with an optimization tool like WP-Optimize. Image Source: WP-Optimize

Kinsta hosting doesn’t rely on Apache, but rather Nginx. If you experience the 406 error, don’t hesitate to contact Kinsta customer support or your hosting provider for assistance.

Analyze Your Server Logs

The previous recommendations focus on client-side and CMS-oriented troubleshooting. Now we’ll consider all server-side issues. This tip, and the ones following, are best if you aren’t using a CMS or know that the 406 error has no connection to your CMS or client machine.

The first step in troubleshooting the server is checking the logs. It doesn’t matter what type of web application, CMS, or web design system you use; they all have server-side logs.

The application logs store that web application’s entire (or recent) history, with information about each database inquiry, results provided, pages requested, and much more. On the other hand, the server logs contain information about the health and status of the server or hardware used to run the web application.

For Kinsta users, you can find error and server logs in the MyKinsta dashboard. Check all logs that may be causing the 406 error:

  • The error.log file
  • The kinsta-cache-perf.log file
  • The access.log file
checking logs while troubleshooting the 406 error

To see the three necessary logs, click on the Sites tab, choose your site, then the Logs button, along with the type of log from the dropdown menu.

You can also check raw access and WordPress error log files with an FTP client. Other options include enabling error logs in wp-config.php and going through the debug mode in the MyKinsta dashboard.

If you have problems finding the error logs or don’t know how to interpret them, contact the Kinsta customer support team for assistance.

Debug the Web Application (Like WordPress)

Like most web applications have server and error logs, they also typically provide information about debugging the application itself. Debugging involves going through the application’s code to find and eliminate minor errors (or bugs).

One of the best ways to run a complete scan of WordPress (and any web application for that matter) is to debug the database and website files. Luckily, debugging doesn’t mean you have to read through every line of code and pick out the bugs yourself. Programs are available for this specific purpose, and as we mentioned earlier, Kinsta even has its debugging tool within the MyKinsta dashboard.

Start the debugging process by learning the basics of debugging WordPress with the Kinsta Debug Mode, WordPress Debug plugins, or a more manual process:

use WordPress debugging for 406 error

Sites > Tools brings you to a page to activate the WordPress Debugging Mode feature in the Kinsta dashboard.

Preventing the 406 Error in the Future

The problem with the 406 error is that it can pop up in many different situations. You might see the “406 Not Acceptable HTTP” error while browsing through Hulu or Netflix as a regular consumer.

That isn’t very pleasant, but nothing a little troubleshooting can’t fix. The more concerning occurrence of the 406 error is when it happens on your website or application. For those instances, you’ll need to check the server and CMS site files.

If it’s your website, you’ll want to prevent the error from ever happening again. Plugins, themes, and human error can always come into play, but we have a few suggestions to keep your databases and site files clean into the future:

  • Only install necessary and reputable plugins, themes, and extensions. Always keep these elements to a minimum.
  • Don’t ever modify the core WordPress files unless you absolutely must and know what you’re doing.
  • Run a database cleaner and site optimizer regularly. We recommend completing this process every month and ideally finding a cleaner plugin that runs automatically in the background.
  • Make a habit of debugging your server and web application. As mentioned, Kinsta offers a Debugging feature in its dashboard. Many other applications have this type of functionality as well.
  • Set automated backups of your website or application. This way, a code conflict or error won’t cause you much stress since you can restore a previous version of the website and start from there.
  • Run a manual backup of your site before you plan on updating WordPress and any plugins, even if you already run automated backups (better safe than sorry). It’s also wise to run backups before editing any files or adding new code to your site.

In addition to looking unprofessional and causing confusion, the 406 error can cause you to lose sales or users 💸 Learn how to fix it here ⬇️Click to Tweet

Summary

You can fix the 406 error in several ways. As long as you know what you are seeing and where to look for the fix, you should be able to clear the error up.

While this is not one of the more common WordPress errors, it is one you will see from time to time if your configuration is not correct.

Do you have any other recommendations for resolving “406 Not Acceptable” errors? Please share them in the comments section below!


Save time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience reach with 28 data centers worldwide.
  • Optimization with our built-in Application Performance Monitoring.

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Check out our plans or talk to sales to find the plan that’s right for you.






Leave a Reply