Fix WordPress You Do Not Have Sufficient Permissions to Access This Page

Updated 5/10/2017 –  While this post primarily addresses the permissions problem with a local WordPress installation, recent upgrades of WordPress sometimes cause plugin issues that result in this error.  Please see the section below entitled “Faulty Plugins” for further information.

Fix WordPress You Do Not Have Sufficient Permissions to Access This Page

So you’ve created a local installation of your WordPress site. Now you have the WordPress “You do not have sufficient permissions to access this page” error.  Over and over no matter what you try. UGH!

There are dozens of blog posts with excellent solutions to this problem. But if you’ve been at WordPress for any length of time, you’ve probably discovered that  many of the hacks and tweaks that work for others just don’t fix your problem. It’s happened to me, too.

Just last week I created a local installation of a WordPress site using Bitnami.

I followed the steps for creating a local copy of a live WordPress site.

But no matter what I did, I kept getting the dreaded WordPress “You do not have sufficient permissions to access this page. I knew it was a database permissions problem, but I just couldn’t get the right combinations of tweaks to work. The problem turned out to be incomplete WordPress admin user data because of corrupt tables.

I finally came up with the manual procedure that fixed my particular problem. Those troubleshooting steps are listed in Option 2 below. Option 1 explains how to use MySQL to add an admin record.

But first, you might want to try using a different browser. A reader recently posted that he was getting this error with Firefox but was able to access his site using a different browser. Browser caching can definitely cause problems like this, so it’s a great tip to try first.

If that doesn’t help, try either of the following options:

Option 1. Use MySQL Code to Insert Administrative-Level Access

Refer to this short post by Brian Fegter at coderrr.com that shows how to use MySQL to insert a WordPress admin user. If you have access to your database, the code will give you administrator-level access to your WordPress installation.  Create a backup of your installation first. Then carefully follow the author’s instructions. Once done, you should be able to log in with administrative access. I tried it and it works great!

If that does not resolve your access problems, please refer to the following manual steps in troubleshooting:

Option 2. Manual Procedure to Troubleshoot Administrative Access Problems

1. Make sure you have completely downloaded from the server all files and folders including wp-admin, wp-content, wp-includes.

2. Open your wp-config.php file and make sure to define the following variables correctly in your wp-config.php. These variable values must match the objects’ values in phpMyAdmin database and tables as follows:

define(‘DB_NAME’, ‘test‘); –  must match db name in database
define(‘DB_USER’, ‘admin‘);  – must match admin user name  in wp_users
define(‘DB_PASSWORD’, ‘password‘);  – must match admin password  in wp_users
define(‘DB_HOST’, ‘localhost‘);  – ‘localhost’ value will point to local server

3. Launch phpMyAdmin for the local site and find the correct database. In this example, it is the ‘test’ database.

phpAdmin-database-screen1

4. Make sure the  wp_usermeta and wp_users tables exist:

phpAdmin-database-screen2

Somehow these tables were corrupt.  Bear with me here. This is the nuts and bolts issue that I was having with my local installation.

5. Open the wp_users table and check these 2 things:

  • You need to have an admin record in wp_users table.
  • Admin record user_login and user_pass columns must match the values in the wp-config.php file:

define(‘DB_USER’, ‘admin‘);
define(‘DB_PASSWORD’, ‘password‘);

6.  Open the wp_usermeta table:

  • Make sure that the wp_usermeta table has an admin record whose user_id matches the admin ID record in wp_users.
  • Check the wp_capabilities column for admin and make sure the value is set to: a:1:{s:13:”administrator”;s:1:”1″;}.
  • Check the wp_user_level column for admin and make sure the value is set to: 10.

How the Tables Should Look

The screenshot below shows the correct configuration. Note that wp_usermeta has an admin user with a user_id = 1. Note that wp_user also has an admin user with a user_id = 1.

phpMyAdmin_tables

 Related Tables were Corrupt

My problem was that in the local installation the wp_users table was missing admin ID = 1 which was required as that is the admin ID in wp_usermeta.

Since there were multiple user entries in the wp_users table, I deleted all of the other users in order to simplify testing all of this.

Then I manually inserted a new admin record into wp_users with an ID = 1. If you do this, make sure you encrypt the password when adding the record. You do that by setting the function column to “MD5”. See below:

md5

Once done I was able to login and access the dashboard.

I encourage you to try the above procedure if you have tried other solutions and still receive the WordPress “You do not have sufficient permissions to access this page.”

It’s nitty-gritty database stuff, but if you can get to the tables through phpMyAdmin, you should be able to fix the columns so that everything required by WordPress is there. All it takes is one value to be missing or incorrect.

Faulty Plugins

The recent 3.8+ releases of WordPress have been causing a fair share of plugin issues for many WordPress users. In working with a new client who was locked out of the admin area due to permissions problems, we discovered that the iThemes Security (formerly Better WP Security) broke after WordPress was upgraded to version 3.8.2.

When trying to access WP-Admin via the plugin’s interface, the Better WP Security plugin script threw an error. We were also locked out of the normal WP-Admin access with the “You do not have sufficient permissions to access this page” error because the login was redirected through Better WP Security’s interface, which was broken.

The fix is fairly straightforward. To test for a broken plugin, you can log into ftp or cpanel and rename the plugin or delete it altogether.  Once done, the scripting error was solved, but obviously we could not log into the admin area  using the plugin’s interface. We  were, however, able to access WP-Admin through the default interface. The permissions error was solved when the faulty plugin was deleted. Finally the WordPress login screen became available to us.

So definitely try removing faulty plugins one by one before resorting to a database restore.

Any questions, comments, or other suggestions for this particular issue?  If so, please post in the comments below!

47
Leave a Reply

avatar
20 Comment threads
27 Thread replies
2 Followers
 
Most reacted comment
Hottest comment thread
21 Comment authors
lligaoJOhnrelJulian KingmanAbhinandan DubeyFabian Recent comment authors
newest oldest most voted
lligao
Guest
lligao

Thank you ~ you saved my life!

Julian Kingman
Guest
Julian Kingman

Thank you, you saved my life! I guess it was a corrupt record, because adding a new user solved my woes. Well, my logging in woes. Now I need to figure out why the rest of the site was destroyed :/

Abhinandan Dubey
Guest
Abhinandan Dubey

Thank you so much Michelle ! I was stuck so badly in this messy issue and after trying virtually everything, Your Option 2 worked out ! Thanks a ton !

Fabian
Guest
Fabian

Thanks so much, alone “Browser caching can definitely cause problems like this, so it’s a great tip to try first.” saved my life. Thanks!

okan
Guest
okan

Thanks for the tip, saved me a lot of time. After installing Adsense I was locked out from my site. I deleted the plugin using cpanel, under public_html/wp-content/plugins and now I can login.

zayramo
Guest
zayramo

Hi, Is there a service that work this issue? Ive been working and paying to fix this problem. Nobody can get on this with a solution.

Tim
Guest
Tim

You geniuses! I have been trying to gain access to my site for weeks after being hacked, and as I had the AIOS security plugin it had messed my tables up! Now I have access by following your steps!! Thanks

Casper Nybroe
Guest
Casper Nybroe

Okay, so I tried both the options without fixing the problem. My problem startet when I changed the DB_CHARSET in the wp-config file from utf8 to utf-8. I changed it back after refreshing the frontpage, so I didn’t to anything in the backend. I mailed Michelle which told me to try and make a fresh version of the wp-config file. I did this through Notepad++. No results – still getting the error. When I get the error my URL is: site.com/wp-admin/profile.php If I change the URL to: site.com/wp-admin It still gives me the same errors. I am kinda lost here!… Read more »

Jamie Ricafrente
Guest
Jamie Ricafrente

Thank you very much. Just as I suspected a new plug-in I installed is causing some problems. So renaming the directory of the plug-in through c-panel as suggested in one of your tips solved my problem.

franklinlee
Guest

Hi Michelle Phillips, thanks for the tutorial. We tried what you posted. And its works very well thanks for your blog post.

henry
Guest
henry

Wow Michelle. I don’t normally comment on anything online – but I got stuck with no access to my wp site and you saved the day – I am a seasoned coder and experienced in Drupal but this is my first foray into WP. Thanks

vanessaholgate
Guest
vanessaholgate

Thanks so much for updating your post to include Faulty Plugins. I’m burning the midnight oil and had an issue with a plugin. I went into my cPanel to change the name via the File Manager. It is working great now and I can finally call it a night!

Sawnoff
Guest
Sawnoff

Thanks for the tip on iThemes Security – I disabled it via FTP and was able to login, then re-activated and updated – seems to work now.

Ashraf Badr Elden
Guest
Ethan
Guest
Ethan

Hi there, thanks for the tutorial. We tried what you posted. However, we are still getting the “You do not have sufficient permissions to access this page.”

We have setup a temp url for wordpress and changed the url details in phpmyadmin, we have also followed your process above, we have also deleted any of the plugins, however, we still get the same error. Any ideas what else we can check.

We have 3.8 installed. Ta.

Vikram Sinha
Guest
Vikram Sinha

I don’t know how relevant my troubleshooting is .. but with the recent upgrade to wordpress 3.8 messed few things including the error you posted .. One simple solution to this problem in this version (3.8) is to simply delete the faulty plugin / update installed. To Identify .. try with the latest ones you installed in wordpress.

Prashant Bharti
Guest
Prashant Bharti

Thanks for great post i work on this issue from 1 days but now fix it.
Thanks for sharing

darko
Guest
darko

thank you I ruin everything now

goldfinger
Guest
goldfinger

There are many ways to solve the problem in Internet. Nothing is work for me except your way. Thank a lot. You really save my life.

Scroll to Top

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close