Filter users by custom colum not meta key

This isn’t possible with custom table columns, and you should avoid and move away from custom modifications to WP Core tables. Instead, store this data in user meta instead of custom table columns.

When you next update WordPress, if the database schema will change, WP will adjust the tables to match, destroying your custom columns and all the data they contain ( or the update will fail ).

The API you attempted to use was intended for these user meta values, you can adjust user meta just like post meta:

  • add_user_meta
  • update_user_meta
  • get_user_meta
  • delete_user_meta

You can simplify your code by using these instead, it will allow you to eliminate the raw SQL needed to adjust the table and save/fetch information, and allow you to use WP APIs as intended.

And remember, never modify WP Core to change WP, that includes the table columns.