WordPress Admin - Sorry, you are not allowed to access this page

Issue

After moving a WordPress blog to a new server admin user can no longer access admin control panel. The same user can login to the website front-end with no issues, but as soon as he tries to access wp-admin page following error is displayed:

Sorry, you are not allowed to access this page.

Resolution

The issue was caused by modified table prefixes on WordPress MySQL database. Even though the correct prefix was entered in wp-config.php file, there were some leftover references to the old prefix in some MySQL tables. Specifically:

  • _usermeta table had bunch of references to the old prefix in meta_key column
  • _options table had one reference in option_name column (<prefix>_user_roles)

Replacing old prefixes with the correct ones resolved the issue.

 

February 2017
WordPress 4.7.2

 

Newsletter

Subscribe to receive occasional updates on new posts.
Your email will not be used for any other purpose and you can unsubscribe at any time.
Please wait