Can’t Access WP-Admin Dashboard in WordPress After Migration
Have you ever migrated a WordPress website from one host to another, and then you cannot access the Dashboard, even if you have Administrator privileges in the original site?
Now, have you tried every other thing that all the troubleshooting sites said to do, and it still doesn’t work?
If the new hosting has a different database prefix than the original site, that can be the problem.
For clarification, this is what the message says when you login to your migrated WordPress site and then you try to go to the Dashboard at /wp-admin or whatever URL you are using for the Dashboard.
Sorry, you are not allowed to access this page.
Keep Reading If You’ve Already Tried All These Things
I couldn’t figure this out and I tried all the following, which you can read on most of the other troubleshooting articles, and this did not solve my issue.
- Deactivated all plugins.
- Deactivated all themes but default theme.
- Added or edited the
.htaccessfile - Re-installed or re-uploaded a fresh version of WordPress.
- Checked the
wp-config.phpfile - Cleared the browser and server caches.
If you already did all those things and you still can’t access the WordPress Dashboard, but you can log in, this might be the problem.
How to Solve the Missing Dashboard Area
Follow these steps to get access to the WordPress Dashboard.
Step 1: Check the wp-config File for the database prefix.
If the old prefix was, for instance, wp_ and the new database has a different prefix, you’ll need to change the database table names have the new prefix.
Step 2: Change the prefix on all the database tables.
If the database prefix was different, you can change it to match so the new database works with the migrated site. You can use MySQL to do this, or do it manually in phpAdmin.
Step 3: You’ll need to change these database rows to the new prefix too.
In the _options table, look for the row _user_roles. This one needs to have the new prefix, so if it was something like _wp, change it to the new prefix.
In the _usermeta table, for each user, find the rows _user_level and _capabilities . These need to have the new prefix too, so if it was something like _wp, change it to the new prefix.
Don’t change any other database rows.
Refresh the page and you should have access to the WordPress Dashboard.
Conclusion
TLDR: The issue might be with the database prefix, and you need to change the prefix for all the database tables to match the wp-config.php file, and then also the prefix for _user_roles in the _options table, and the _capabilities and _user_level in the _usermeta table for all users. Make sure the prefix is the same for all of those and you should regain access to the Dashboard when you log into WordPress in the migrated site on the new hosting.