29 Mar 2013

Blog: WP “You do not have sufficient permissions” error


I got a call earlier today from one of the journalists from L’Economiste Maghrebin with an issue. She couldn’t access the back-end of the site.

So, I went in, and I got WordPress’ BSD (blue screen of death on Windows Machines):

“You do not have sufficient permissions to access this page.”

At first, I shrugged, and absolutely thought I’d get that fixed within the hour. Boy was I wrong.

Here are some common solutions to this problem:

  • Plugins

    If you recently added a plugin, access the site with FTP, go to wp-content/plugins and rename the folder of said plugin before refreshing the page. This didn’t work for me.

  • Refresh your install

    Get a fresh zip from WordPress, and overwrite everything but wp-config.php and the wp-content directory using FTP. Make sure the files have transferred correctly. Refresh the page.
    As before, it didn’t work for me.

  • .htaccess, cookies and caching plugins

    • If you have a WP caching plugin, find the folder where the cache is and empty it out or rename it.
    • If you have a custom .htaccess, delete/rename it.
    • Delete the site’s cookies from your browser


  • Repair your database

    You can do this either by going to your phpmyadmin and checking the tables with overhead, then clicking on repair, or you can use the rarely used WP Maintenance Repair script that’s included with WP. None of these worked for me.

  • Check your database’s wp_users and wp_usermeta tables

    Check that your user roles are correct.

  • Force Upgrade the database

    Open phpmyadmin, and browse the wp_options table until you find the db_version row. Change the value, then upgrade your db.

After trying the above one by one, I started wanting to bash my head against the desk. Nothing worked. I still had the dreaded error.

So, I did what anyone else would do in my position, I opened the db and started going row by row. And, that’s when I noticed something weird in wp_options (always check that one first).

The wp_user_roles in the wp_options table seemed off. This is the code it contained:

I opened another install’s database and checked the contents of wp_user_roles, and it had this content:

So, I just thought, what the hell, grabbed the working database’s wp_user_roles content, and put it in the database of the one that wasn’t working.

And it fixed it! I have no idea what plugin messed things up, or what happened exactly, but I do know that I could finally call back the client and tell them it was resolved. Thank goodness.

As always, I thought I’d share the solution of an issue that drives people absolutely nuts, just to help someone out.

Share it!

1 Comment on "WP “You do not have sufficient permissions” error"

  1. Didn’t work for me :(

    Posted by Sachin Verma, the 13th October, 2013 | Reply

Leave a Reply

Connect with Facebook