Adding column to wpex_users

You should never modify the WP core tables, all your changes will be undone and the data lost the next time WP updates its table schema.

Instead, if you want to store more data on a user, do what other people do and use user meta:

  • update_user_meta
  • get_user_meta
  • add_user_meta
  • delete_user_meta

You can even query for it with WP_User_Query.

Otherwise, by adding custom columns, you’ll have to write a tonne of SQL code from scratch, and risk major data loss.