WordPress 406 errors “Not acceptable…”

If you’ve recently upgraded to WordPress 2.1, you may encounter a 406 error when you try to post, edit posts, access options, etc. This has something to do with your host using mod_security, or something. A good 45 minutes of searching did not turn up an exact reason for this.

But it did turn up a couple of workarounds. One involved turning the mod_security engine off completely, but that’s a bad idea because mod_security helps keep your files secure. Instead, you can turn it off just on those files that are acting up:

  1. Create an .htaccess file in your /wp-admin folder.
  2. Put the following in it:

<Files options.php>
SecFilterInheritance Off
</Files>

<Files post.php>
SecFilterInheritance Off
</Files>

<Files edit.php>
SecFilterInheritance Off
</Files>

<Files page.php>
SecFilterInheritance Off
</Files>

See how it works?  If you’re encountering the error when you try to “edit” files, you need to turn off security just on the wp-admin/edit.php file.  You can make more of these for other pages by simply putting the page name in place of “options.php” in the top example.

3 Responses to “WordPress 406 errors “Not acceptable…””

  1. SarahG says:

    Hey thanks for the post, has just answered my constant questions over annoyance at this error and saved me a lot of time with a plugin I’m working on!

  2. [...] I’d do a bit of searching before rewriting my plugin! A quick look on Yahoo and I came across ChillyCool who had posted up about this plus given a fix. Fantastic. However the fix was to add some code into [...]

  3. Elmernite says:

    I know this is kinda old. But your solution seems so much better than turning it off altogether! All of the other blogs that mention this problem tell you to turn it off altogether!
    Thank you!
    -Elmernite

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Don't miss an article!

 Subscribe in a reader or get every article delivered by email