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