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

WordPress Logo and Words "Fix WordPress You Do Not Have Sufficient Permissions to Access this Page"

Are you getting the WordPress error “You do not have sufficient permissions to access this page” error over and over no matter what you try. I’m sorry to hear it and hope this post helps!

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

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.

A while ago I created a local installation of a WordPress site using Bitnami.

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 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 WordPress site first. Then carefully follow the author’s instructions. Once done, you should be able to log in with administrative access.

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

New releases of WordPress can cause 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.

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 we still 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.

I hope this post helps you fix the “WordPress You Do Not have Sufficient Permissions” error.

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
  Subscribe  
newest oldest most voted
Notify of
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 :/

Michelle Phillips
Guest
Michelle Phillips

You’re very welcome, Julian, glad this helped. Thanks for letting me know! Hope you resolve the rest of the site soon πŸ™‚

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 !

Michelle Phillips
Guest
Michelle Phillips

I’m so glad to hear this post helped you, Abhinandan! Thanks very much for taking time to leave a comment and let me know! πŸ™‚

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!

Michelle Phillips
Guest
Michelle Phillips

Excellent to hear, Fabian! Thank you so much for taking time to leave a comment to let me know you found that tip useful!

Michelle Phillips
Guest
Michelle Phillips

Excellent advice, Benjam! Thanks so much for taking time to share your solution!

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.

Michelle Phillips
Guest
Michelle Phillips

I’m glad the post helped! I always appreciate when visitors leave a comment to let me know ~ so thanks!

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.

Michelle Phillips
Guest
Michelle Phillips

Hi, sorry for your trouble with this. I will send you an email shortly. Thanks for contacting us.

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

Michelle Phillips
Guest
Michelle Phillips

You’re welcome, Tim! So glad we were able to help. Thanks for taking time to leave a comment πŸ™‚

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 Β»

Michelle Phillips
Guest
Michelle Phillips

Hi Casper, I had another thought. Could you create a fresh install of WordPress (either locally or in a sub-folder on the server) and then import your backed up database to the new installation? I really think it’s one of the WordPress files that’s corrupt and that would be one way to test it.

Casper Nybroe
Guest
Casper Nybroe

Hi Michell
I could try that. The only thing I am worried about is that the former desingers have been making a lot of personalized coding in different functionfiles, themes and all that. How do I make sure, that the correct theme, features, files, plugins ect. comes with the fresh install?

Michelle Phillips
Guest
Michelle Phillips

Unless these changes were made in a child theme, those customizations will be lost with a fresh install. And you will need to reinstall all required plugins, customizations, etc. I have one last thought. Can you contact the hosting provider and see if they have done any server backups that can be restored? Most providers will have some sort of backup system in place; you may not have the most current version of the site, but it’s better than starting from scratch. Good luck and I hope that it all works out for you, Casper!

Casper Nybroe
Guest
Casper Nybroe

I have gone through all the plugins – none of them were the problem.
When I made a fresh wp-config file it had no end tag “?>”. At wordpress own site for making a fresh one they didn’t put the end tag in. But at their tutorial for editing it they said you should make sure that is has an end tag.
So should it have one or not? πŸ™‚

Michelle Phillips
Guest
Michelle Phillips

I have seen both ways and it seems they both work OK. However, best practices dictate the closing tag.

Casper Nybroe
Guest
Casper Nybroe

I have partially fixed it. I can now login and change the user, post, blogs and so on. My wp_user_roles only had this as its option_value:
a:1:{s:8:”inactive”;a:2:{s:4:”name”;s:8:”Inactive”;s:12:”capabilities”;a:0:{}}}

I found a post which showed me how to reset it to the default settings.
http://wp-relief.com/2011/12/01/user-roles-in-the-wordpress-database/

This is good – I am now in the backend! Although my woocommerce and other plugins arent showing. If I click the “plugin” tag I can see that it is still installed. However if I click “settings” I get the “you do not have permission” error yet again.
Do you have any idea how to fix this?

Casper Nybroe
Guest
Casper Nybroe

SOLVED.
I restored my wp_user_roles to its standard settings from the link that I listet earlier. I fixed the problem with WooCommerce by simply just deactivating in and reactivating it. πŸ˜€
Even though your solutions didn’t work I wouldn’t had figured this out without your post!
Thank you for your help!

Michelle Phillips
Guest
Michelle Phillips

Hooray!! Thanks for letting me know; it’s so hard to troubleshoot some of these issues when you’re not actually in the dashboard. But hopefully your solution will help someone else, too! Thanks for posting it, Casper πŸ™‚

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.

Michelle Phillips
Guest
Michelle Phillips

You’re welcome, Jamie! Glad to help; thanks for letting me know πŸ™‚

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

Michelle Phillips
Guest
Michelle Phillips

Hi Henry, so glad the post helped you out! I really appreciate you taking time to leave a comment and let me know πŸ™‚

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!

Michelle Phillips
Guest
Michelle Phillips

Glad this helped! I’m always happy to hear feedback like this πŸ™‚ Thanks so much for taking time to leave a comment!

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.

Michelle Phillips
Guest
Michelle Phillips

Glad to hear this helped! Thanks for letting me know.

Ashraf Badr Elden
Guest
Ashraf Badr Elden
Michelle Phillips
Guest
Michelle Phillips

Great! Thank you for the link. It explains that if you changed the prefix of your database tables, you could also get sufficient permission error. It also shows how to fix the problem by executing a SQL command through phpMyAdmin.

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.

Michelle Phillips
Guest
Michelle Phillips

Hi Ethan,
Sorry you are still experiencing this error. Is this a stand-alone website or a multisite? I still think there is something out-of-sync with your database tables. If it’s a multisite, here is a link that might help: http://wordpress.stackexchange.com/questions/82520/troubleshooting-a-you-do-not-have-sufficient-permissions-to-access-this-page-e/82521#82521.

You’ve probably done all these things but recheck that admin capabilities are properly set. One more thing ~ I’ve also had issues with WP Super Cache being stubborn. Make sure you delete the cache and clear your browser cookies. Try logging in from an icognito window. Please let us know what you discover. Good luck!

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.

Michelle Phillips
Guest
Michelle Phillips

Thanks so much for your comment, Vikram. That is a great suggestion for people troubleshooting this error after a WordPress 3.8 upgrade. And it’s much simpler, too! The initial post was written for an earlier version of WP. Hopefully others who are troubleshooting this error will also share their solutions, too. Thanks again!

Prashant Bharti
Guest
Prashant Bharti

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

Michelle Phillips
Guest
Michelle Phillips

Excellent! I’m glad you fount the post helpful. Thank you for your comment πŸ™‚

darko
Guest
darko

thank you I ruin everything now

Michelle Phillips
Guest
Michelle Phillips

Could you please clarify? Did you mean everything is running now or did you have a problem with our solution? Please let me know so I can try and help if there was a problem.Thank you for leaving a comment.

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.

Michelle Phillips
Guest
Michelle Phillips

I’m very happy to hear this post was helpful to you. Thanks for taking time to leave a comment!

JOhnrel
Guest

Thank you..

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