Solution for You do not have sufficient permissions to access this page WordPress Error
The WordPress error You do not have sufficient permissions to access this page is typically encountered when trying to access the WordPress dashboard or admin pages after you have changed the WordPress database table prefix, or moved WordPress from one hosting provider to another, or just upgraded your WordPress.
To fix this problem and regain access to the WordPress dashboard you have to manually change some entries from the table wp_usermeta in the WordPress MySQL database. In this WordPress tutorial we will explain which entries should be changed and how to change them using the phpMyAdmin or MySQL commands.
Change Records from wp_usermeta Table using phpMyAdmin
- Login to your hosting provider CPanel and launch phpMyAdmin which can be found in the Databases section as seen in the below screenshot.
- Once logged in to PHPMyAdmin, select the WordPress MySQL database. If you have multiple databases and not sure which is the WordPress database, you can find the name of the database from the WordPress wp-config.php file, e.g. define(‘DB_NAME’, ‘wpdb’).
- Once the WordPress database is selected a list of all the tables in the database is populated as seen in the below screenshot. Click on the table wp_usermeta to access its content. The default WordPress table prefix is wp therefore if you just changed the prefix to e.g. Kyp51, the table name will be Kyp51_usermeta.
- Once the list of user options is loaded, change the prefix of the following entries in the meta_key column for the administrator username to match the prefix you have configured in your WordPress wp-config.php file. If you have multiple WordPress users, you might need to change the below list of entries for each and every WordPress user.
Example: if the current WordPress database table prefix is Kyp51, the entries should be renamed to:
WP White Security Tips:
- Ensure that the CaPiTaLiZatIoN of the prefix matches that of the prefix for all database tables.
- If you installed third party plugins or themes that add entries to this table you might need to change their prefix as well. In this example we used a default WordPress installation database.
Once the above database records from the wp_usermeta table have been renamed, you should be able to login to the WordPress dashboard.
Change Records from wp_usermeta Table using MySQL Commands
- Login to MySQL using the below command and once prompted specify the root password:
mysql –host localhost –u root -p
- Select the WordPress database using the below command. In our example, the WordPress MySQL database is called wpdb:
- Run the following MYSQL commands to rename the prefix of the rows mentioned in step 4 of the above guide. In our example we are renaming the prefix to Kyp51.
UPDATE `wpdb`.`wp_usermeta` SET `meta_key` = 'Kyp51_capabilities' WHERE `wp_usermeta`.`umeta_id` =10; UPDATE `wpdb`.`wp_usermeta` SET `meta_key` = 'Kyp51_user_level' WHERE `wp_usermeta`.`umeta_id` =11; UPDATE `wpdb`.`wp_usermeta` SET `meta_key` = 'Kyp51_user-settings' WHERE `wp_usermeta`.`umeta_id` =14; UPDATE `wpdb`.`wp_usermeta` SET `meta_key` = 'Kyp51_user-settings-time' WHERE `wp_usermeta`.`umeta_id` =15; UPDATE `wpdb`.`wp_usermeta` SET `meta_key` = 'Kyp51_dashboard_quick_press_last_post_id' WHERE `wp_usermeta`.`umeta_id` =16;
A default WordPress installation was used in the above example. In a real live WordPress installation the umeta_id number of the rows you would like to change might be different. It is recommended to check the value of every row before renaming it by using the below command. Change the umeta_id value to match the row you would like to check:
select * from wp_usermeta where umeta_id=10;
Once the above records from the wp_usermeta table have been renamed, you should be able to login to the WordPress dashboard.
If you want to learn how to further harden your WordPress website, read the definitive guide about WordPress security and hardening.
I have the message “You do not have sufficient permissions to access this page”, I created a subdomain and install wordpress, I let the new installation grab the users from the “root domain” and change the DB table_prefix, I can log in with the same user and password that is on root domain, but when I try to go in the dashboard this error accurs.
I read that is some related cookie session but It doesm’t seems to work for my, any ideas?
Thanks in advanced.
P.S. My code is
It is quite difficult to say what is wrong offhand. Get in touch with us on email@example.com so we can look into your issue.
A couple of months ago my Dashboard link disappeared in wp-admin. This has resulted in Permission errors (You do not have sufficient permissions to access this page.) on several admin links including the ability to update wordpress which I have set to automatically update but for the new 4.2 it keeps asking me to update. When I click the link again, the permissions error. Most links in the top bar give me the permissions error also.
I have replaced ALL admin files using FTP as well as deactivating all plugins AND renaming the plugins folder to no avail.
HOW can I get this dashboard link back so I can get my wordpress admin working properly again??
Will the above help me and if not is it reversible?
Such issue is derived from the settings in the database rather than the files themselves. Yes such solution in this post should help. Give it a shot and let us know.
Please help to solve. I can login to dashboard with super user account. But for some plugins access prohibited and see this notification. So above solution when wp was migrated and table suffix’es need to update. But in my case website run ok, super user can login and manage site except access to some plugins’ setting pages (only in admin panel), on frontend everything works without a problems. Please help to solve it 🙂
Thank you for your comment. It is very difficult to troubleshoot such an issue without having a better insight of the website. So can you please send me an email on firstname.lastname@example.org so we can help you solve your issue?
Thanks changing database prefix solved my problem. Thanks a ton!
Not sure if this is a new issue from WordPress 5.6 but just had this issue and the fix described worked fine before but still no joy.
Now you also have to edit option_name = ‘wp_user_roles’ in wp_options. Just make a copy with the new table_prefifx.
Paul, thank you very much a lot! I have been two daysstruggling with this issue until I saw your comment.
We’re glad that you found this article helpful.
Thanks a lot for reaching out and sharing your feedback.