Wordpress - Where are available Roles Defined in the wp_ database?

User roles are stored in wp_options table.

search for option name wp_user_roles in the wp_options table.


User Roles are stored in table wp_user_meta

To check user roles, first, check out the user id in the table wp_users (Column name ID)

Now Go to table wp_usermeta and search where column user_id is equal to the ID that matches ID from wp_users table.

You will get a list of rows with metadata of the chosen user, the row with meta_key as wp_capabilities defines the user role.

The Value of wp_capabilities for

  • Admin : a:1:{s:13:"administrator";b:1;}
  • Woo Commerce Customer : a:1:{s:8:"customer";b:1;}