Get an array of meta_values for a user meta_key
You just need to add a DISTINCT to your SQL query, something like: $cities = $wpdb->get_col(“SELECT DISTINCT(meta_value) FROM $wpdb->usermeta WHERE meta_key = ‘my_cities_meta_key'” ); Alternatively, if you want to do it with php for some reason (if you want to know that a city is listed twice before displaying only unique entries) $cities = $wpdb->get_col(“SELECT … Read more