The Best Way To Fix Error 406 in WordPress Site

Published on


Wordpress 406 Error Solution

Here is Resolution for Error 406 in WordPress

Error 406 in WordPress

Sometimes we get Error 406 in WordPress site and below solution helps most of the time.

We see “406 not acceptable error” largely due to restrictions on the web server.

Most web hosts install a program called “ModSecurity” to protect the web server from malicious actors like spammers, hackers etc.

ModSecurity generally block malicious requests to the web server with a “406 not acceptable error”. But often it blocks legitimate requests as well.

Recently in one of the VPS server that we manage, we saw ModSecurity blocking a genuine request. On trying to Publish a WordPress post, website owner was presented with the error.

To fix the error 406 in WordPress, our Support Engineers analyze the ModSecurity logs and that helps to identify the exact rule that caused the block.

If the request from browser is genuine and ModSecurity wrongly blocked it, we disable this particular rule for the domain.

When selective disabling of rules do not work, the only option left is to Turn OFF ModSecurity completely for the domain.

In cPanel servers, there is an option to do this from the cPanel of the domain.

First of all take backup of your .htaccess file (If you are in linux hosting make sure you have checked “show hidden files” by going to site settings ( in cpanel). If there is no .htaccess file then create one and paste below code and save it.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Hope this will help. Happy coding.

Get in touch for a free consultation