It’s typical to run across errors while managing WordPress websites, and the “406 Not Acceptable” error is one of them. This error code is generally referred to as an HTTP response or status code which anyone can encounter while visiting a site.

It disrupts the functionality and accessibility of a site, causing frustration for site owners and visitors.  

It’s essential to understand the reason behind the “406 Not Acceptable” error to analyze and fix it efficiently. Otherwise, it will make your website look unprofessional and unsafe to visit. Moreover, you might be losing traffic or sales if the error persists on your WordPress site. 

In this article, we will first introduce you to the “406 Not Acceptable” error. Then we will explore the reasons behind this error. Finally, we will provide you with a proper guide to resolve it. So, let’s dive in and get your  WordPress site up and running smoothly again.

What is the “406 Not Acceptable” Error?

The “406 Not Acceptable” Error is an HTTP status code that is presented when a server can’t process a user’s request. Since the client’s request headers are invalid, the server returns the message “406 Not Acceptable”.

It’s a client-side error, which means the server is unable to provide the requested content in a manner that complies with the specifications stated in the client’s request. 

406 Not Acceptable Error Example

406 error often indicates that a user cannot access particular pages or media assets on a WordPress site. Therefore, they are shown an error message instead of the anticipated material. Besides, the message can vary based on the browser being utilized. 

So, what’s the primary cause of the “406 Not Acceptable” error? It’s the content negotiation process that takes place between the client and the server.

Content negotiation is the process through which the server and client converse to decide on the best way to display a resource. Some of examples are language preferences, character sets, and media file types.

The content and the format of the 406 error message can vary depending on the specific website, hosting environment, and browser being used to access the site.

But sometimes, the error message can include helpful information that may assist in locating the reason behind the error. However, there are times when the error message only says “406 Not Acceptable” without any more details. 

Now you know what the “406 Not Acceptable” error is and how it looks on WordPress. Let’s find out some common reasons behind it.

Reasons Behind “406 Not Acceptable” Error in WordPress

When you access a web page through your browser ( Chrome, Edge, Brave, etc.), it interacts with the server to request the required files and contents.

With this interaction, the server can learn what you want to view. Consequently, it ideally reacts by giving the appropriate information to the users. 

Reasons Behind 406 Errors in WordPress

During the initial request phase, the browser includes an “Accept” header that describes the file types it can accept. So, the header itself notifies the server of the preferred file delivery formats for the creation of the entire website or web app.  

However, there are times when the server fails to adhere to the rules set by the client or browser. Thus, it does not deliver the content in the correct format resulting in a “406 Not Acceptable” error. It indicates that the server is unable to provide the expected data delivery. 

Here are some in-depth explanations behind the “406 Not Acceptable” error in WordPress: 

Mismatch In Content Type 

The “406 Not Acceptable” error occurs when the server is unable to supply the requested content in a proper format. The format should be compatible with the “Content-type” that has been provided in the request header. 

For instance, if a client requests and expects an HTML answer from the server, the server can only send JSON or XML. Therefore, it will lead to a content-type mismatch and cause and display the error.  

Absent Or Invalid Accept Headers

The client’s request includes an “Accept” header that lists the media types it is willing to accept for the response. Thus, an error message stating “406 Not Acceptable” will appear if the server is unable to provide the content in any of the listed media formats.  

An error message stating “406 Not Acceptable” will appear if the server is unable to provide the content in any of the listed media formats. Moreover, it occurs when the server does not accept the requested media formats or if the “Accept” header is absent from the client’s request.

Invalid Language Preferences

The preferred language for the response is indicated by the “Accept-language” header in the client’s request. So, The “406 Not Acceptable” error will appear if the server doesn’t have the requested content accessible in any of the listed languages. 

This can happen if the server does not support the requested languages. Also, it occurs if the client’s preferred language does not match the content that is accessible.

Unfulfilled Charset Requirements

The character sets that the client’s request may accept are listed in the “Accept-Charset” header. An error message with the code “406 Not Acceptable” can pop up if the server is unable to provide the requested content in any of the listed character sets. 

This happens if the server does not support the requested character sets. Besides, it happens when the character set choices of the client conflict with the accessible content 

Rules Enforced by Mod_Security

Mod_security is a server module that adds an extra layer of security by applying certain rules. Meanwhile, some mod_security rules could be too tight and consider some client requests to be potentially dangerous.

When a client’s request triggers one of those rules, it can result in the generation of a “406 Not Acceptable” error. 

Conflicting Theme Or Plugin 

Conflicts between themes or plugins that have been installed can also cause the “406 Not Acceptable” error message. These components’ incompatibilities or flawed code might prevent the appropriate creation of content, which would result in the error.

Therefore, it’s crucial to find and fix any plugins or themes that are causing the compatibility issue. 

Bad Server Configuration 

Erroneous or improper server configuration can contribute to the “406 Not Acceptable” error.  Incorrect MIME types or wrong content negotiation settings are examples of this. 

Periodically, the browser may request a certain MIME type from the server. Examples of MIME types include JPEG images, certain video formats, and simple text. If the server is unable to provide the requested MIME type, such as JPEG pictures, you will get a 406 error.

Caching Issues 

By saving copies of previously generated responses, caching can increase the speed of a website. However, cached replies can result in the “406 error if the response is out of date, faulty, or improperly cleared. 

You need to make sure that caching plugins and server-side caches are not obstructing the content delivery. Thus, you need to check and clear your cache periodically to prevent this error. 

It’s time to troubleshoot the error since you’ve learned about the potential causes of the “406 Not Acceptable” error.  

There are different ways to fix the “406 Not Acceptable” error in WordPress. But we will go through the easiest ways to resolve the issue. But before making any changes to your site, you must take a backup of your entire site and its database.

Using a Plugin 

You can easily fix the “406 Not Acceptable” error by accessing your site’s .htaccess file. Simply go through the following steps:

  1. Login to your WordPress website’s dashboard.
  2. Go to Plugin > Add New and enter WP File Manager in the search box 
  3. Then install and activate the plugin
  4. Click File Manager and then right-click the .htaccess file located in your public_html folder. 
Accessing-.htaccess-file
  1. Now click code editor and edit the .htaccess file 
  2. Put the following code in your code editor. Put the code at the exact position located in the image. 
<IfModule mod_security.c>
    SecFilterEngineOff
    SecFilterScanPOSTOff
    </IfModule>
Putting code to remove 406 error

Now let’s move on to another process of fixing the 406 error from WordPress. 

Reviewing Request Headers

While troubleshooting the “406 Not Acceptable” error in WordPress, you can review the request headers. Here is a step-by-step approach:

  1. Ensure that the “Accept” header is formatted correctly and appropriately lists the allowed media formats.
  2. Remove any conflicting or unsupported values from the “Accept” header.
  3. Verify that the “Accept-Language” and “Accept-Charset” headers are accurate.

Verify Plugin & Theme Compatibility

To fix the  “406 Not Acceptable” error, you also need to check your theme and plugin’s compatibility issue. 

Verify Theme & Plugin compatibility
  1. Deactivate each and every plugin on your WordPress website.
  2. Activate a default theme such as Twenty Twenty One
  3. Now take a look if your “406 Not Acceptable” error goes away 
  4. If not, swap themes one at a time and reactivate plugins to find the conflicting one 
  5. Update or replace any outdated or incompatible plugins or themes that are causing the issue. 

Check Your Server Configuration  

You need to make sure that your server is configured to meet the requirements of your WordPress site. Simply go along with the following process: 

Check Server Configuration
  1. Examine your server’s content negotiation settings, MIME types, and mod_security rules
  2. Make those settings appropriate for your WordPress site.
  3. If you need further assistance, speak with the server admin or your hosting company.

Clear Caches of Your Site 

Clearing caches is an essential step in troubleshooting the “406 Not Acceptable” error. Here are the steps that you can follow: 

  1. Clear the caches of your WordPress site using any caching plugin such as W3 Total Cache or WP Super cache
  2. Clear any server-side caches that could be holding out-of-date or damaged responses, such as the Varnish or Redis cache. 

Content Delivery Network Concerns 

If you are utilizing a CDN to boost your site’s performance, verify its configuration. You need to make sure it is serving the most recent versions of the files on your site. These are the steps you can follow: 

  • Clear the cache of your CDN to make sure that it is serving the latest version of your WordPress site. 
  • Verify that the CDN is accurately configured to deliver the desired content.  
  • Examine any conflicts between your WordPress site and the CDN.

Test Several Devices & Browsers  

Checking different devices and browsers

If any browser-specific issue is causing the “406 Not Acceptable” error, follow these steps to resolve it:

  1. Test your website on several browsers and platforms (desktop, mobile, and tablet), including Safari, Firefox, Chrome, and others.
  2. Check to see whether a certain browser or device is the cause of the “406 Not Acceptable” issue.
  3. Look for any CSS or JavaScript issues that are browser-specific and take the appropriate action.

Seek Expert Assistance 

If you’ve tried all the above-mentioned methods and are still unable to solve the error, follow these steps: 

  1. Consult with a WordPress developer to resolve the issue 
  2. Get in touch with the support staff of your hosting company 
  3. Inform them in-depth about the problem and the actions you’ve previously tried.

Best Prevention Practices Against  “406 Not Acceptable” Error

Prevent 406 Not Acceptable Error

The 406 error can occur in a number of circumstances, but you can fix it with some small preventive measures. Thus, you need to adopt a proactive approach to maintain your site and implement optimization.

Here are the preventive measures that you can take to reduce the chances of encountering the “406 Not Acceptable” error: 

  1. Update WordPress Core, Plugins, and themes regularly. Mostly, updates include compatibility improvements and bug fixes, which reduces the likelihood of a “406 Not Acceptable” error.
  2. Verify that new plugins and themes are compatible with the current WordPress version before installing them. Plus, don’t forget to review the user feedback, ratings, and support forums to gauge the plugin or theme’s reliability.
  3. Optimize the essential file types such as images, scripts, and stylesheets of your WordPress site. You can reduce the chance of server-related errors by reducing the file via compression. 
  4. Make sure your server is set up properly to handle various file formats and content types. Moreover, speak with your hosting provider to ensure that MIME types and content negotiation settings are done properly. 
  5. Use a trustworthy CDN to distribute the content of your website over different servers globally. It assists in reducing server load, enhancing website speed, and lowering the possibility of running into server-related issues.
  6. Implement caching mechanisms, such as server-side caching or caching plugins, to store and deliver frequently accessed content.
  7. Conduct regular security audits to find vulnerabilities and make sure your website is safe from attackers.
  8. Check the server logs often for any odd or repeated issues, such as the “406 Not Acceptable” error. Logs can help you quickly discover and fix problems by revealing the sources of the error. 

Final Thoughts 

While browsing a website, facing the  “406 Not Acceptable” can be really annoying for visitors. Moreover, it can be particularly distressing for website owners or service providers. Hence, we’ve provided the best approaches in this guide to resolve the “406 Not Acceptable” error. 

Despite the fact that the 406 error is not among the most frequent WordPress problems, you should be cautious about it.

This error may be avoided by addressing the issues that we’ve mentioned. By fixing the error, you will be able to provide your users with a more streamlined browsing experience and never lose a visitor.

You may also explore how to fix “Failed to Open Stream No Such File or Directory” error in WordPress.