WordPress – Admin role not found

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!

  • Access your wp-config file and check for the following line of code
    $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.)

  • Access you phpMyAdmin and look for wp_options table
  • Look for the folowing option name and update it
    '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’)

  • Save and exit

You might have to clear your browser cache and cookies if you’re still having issues accessing the dashboard.

/

Report (Please include link to post while reporting)

Leave a Reply

Your email address will not be published. Required fields are marked *