You Do Not Have Sufficient Permissions To Access This Page

Last updated on October 18th, 2014 by Robert Abela. Filed under WordPress Security Tutorials & Tips

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

  1. Login to your hosting provider CPanel and launch phpMyAdmin which can be found in the Databases section as seen in the below screenshot.

Databases tools options in hosting provider Cpanel

  1. 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’).
  2. 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.

List of tables in a default WordPress MySQL Database

  1. 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.
  • wp_capabilities
  • wp_user_level
  • wp_user-settings
  • wp_user-settings-time
  • wp_dashboard_quick_press_last_post_id

Records in the wp_usermeta table in the WordPress MySQL database

Example: if the current WordPress database table prefix is Kyp51, the entries should be renamed to:

  • Kyp51_capabilities
  • Kyp51_user_level
  • Kyp51_user-settings
  • Kyp51_user-settings-time
  • Kyp51_dashboard_quick_press_last_post_id

WP White Security Tips:

  1. Ensure that the CaPiTaLiZatIoN of the prefix matches that of the prefix for all database tables.
  2. 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

  1. Login to MySQL using the below command and once prompted specify the root password:
mysql –host localhost –u root -p
  1. Select the WordPress database using the below command. In our example, the WordPress MySQL database is called wpdb:
Use wpdb
  1. 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.

WordPress Hosting, Firewall and Backup

This Website is:

7 comments

Enrique 20/05/2015

Hi Robert,

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.
Enrique

P.S. My code is


define('CUSTOM_USER_TABLE', 'wp_users');
define('CUSTOM_USER_META_TABLE', 'wp_usermeta');

WP White Security 27/05/2015

Hi Enrique,

It is quite difficult to say what is wrong offhand. Get in touch with us on support@wpwhitesecurity.com so we can look into your issue.

Karen 13/06/2015

Hi!

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?

Thank you!

Robert Abela 14/07/2015

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.

Darius 14/08/2017

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 🙂

Robert Abela 19/09/2017

Hello Darius,

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 robert@wpwhitesecurity.com so we can help you solve your issue?

Pratekk Malviyaa 26/05/2019

Thanks changing database prefix solved my problem. Thanks a ton!

Leave a Reply

Your email address will not be published. Required fields are marked *