“Sorry, you are not allowed to access this page” displaying in WP Admin
After a site migration or after certain types of maintenance, you may see this warning when attempting to access wp-admin.
If you attempt to access the /wp-admin side of a WordPress site and are met with a message stating, “Sorry, you are not allowed to access this page”, then you may need to review the roles information of your wp_options database table.
This can happen after a site migration where the table prefix of your wp-config.php file has been updated. For example, if you were to change your table prefix from
ab_ back to the default
wp_, you may think that renaming the tables would be enough. However, WordPress uses the table prefix within its
wp_options table to store information about user roles on the site.
Navigate to your
wp_options table in your database editor and look for a record with an
option_name ending in
user_roles. You should find a record called something like
wp_user_roles, though the
wp_ underscore is subject to change based upon the table prefix you were previously using.
In our example, the
wp_user_roles record may have originally been called
abc_user_roles. Since you changed the table prefix to
wp_, however, WordPress is now looking for an option called
wp_user_roles which does not exist. This means it cannot load the appropriate permissions for user roles on your site which leads to the permissions issue seen within the CMS.
option_name to match your table prefix will resolve this. For example, change the option name from
wp_user_roles and you should be able to access the wp-admin side of your site once again.
A lightweight, intuitive WordPress theme to enable flexible developement.
- Lighting-fast installer
- Intuitive SASS structure