This fix is useful when you have the login credentials to WordPress dashboard, but the login page just redirects you to WordPress homepage. This usually occurs during migrations to new servers. To fix this issue, we’ll need to access the WordPress database through phpMyAdmin.
Take a backup of your database before making any changes to it!
$table_prefix = 'wp_';
(Default wordpress table prefix is wp_, if you’ve changed it, then take a note of the prefix. I’ll keep ‘wp_’ as the prefix for now.)
'prefix_user_roles' , Change it to 'wp_user_roles'
(Say your prefix is 123_xyz, then you’ll need to update the option name to ‘123_xyz_user_roles’)
You might have to clear your browser cache and cookies if you’re still having issues accessing the dashboard.