WordPress “You don’t have permission to do that” error

Your Ad Here

If you have a fresh install of WordPress with plugins deactivated and no special tweaks, it most certainly should not be telling you that you don’t have permission to do things. If it does:

This is a javascript error. I noticed the glitch when I was trying to create new categories - which is an Ajax function. A helpful user on the WordPress forums discovered the solution:

Go into your wp-includes/pluggable.php file. Find this code, or something very similar to it (mine was slightly different, but most of the lines were exact). Now, make a copy of this file before you proceed, because then if it screws something up horribly, you can fix it.

$cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
foreach ( $cookie as $tasty ) {
if ( false !== strpos($tasty, USER_COOKIE) )
$user = substr(strstr($tasty, ‘=’), 1);
if ( false !== strpos($tasty, PASS_COOKIE) )
$pass = substr(strstr($tasty, ‘=’), 1);
}

Replace it with:

$user = $_COOKIE[USER_COOKIE];
$pass = $_COOKIE[PASS_COOKIE];

1 Comment »

  1. Wordpress Plugin for “You Don’t Have Permission to do that” error | ChillyCool Web Digger Said,

    September 5, 2007 @ 1:08 pm

    [...] while back, I posted a fix for the “You Don’t Have Permission to do that” error that Wordpress 2+ sometim… etc. My fix involved editing a core file, which not every user is comfortable doing (and you have [...]

Leave a Comment