Title: Using WP_User_Query on Pods fields
Last modified: April 2, 2019

---

# Using WP_User_Query on Pods fields

 *  Resolved [Matt Knowles](https://wordpress.org/support/users/aestheticdesign/)
 * (@aestheticdesign)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/using-wp_user_query-on-pods-fields/)
 * After coming across your tutorial at [https://docs.pods.io/tutorials/creating-user-directory/step-5-creating-a-list-of-users-and-profile-page/](https://docs.pods.io/tutorials/creating-user-directory/step-5-creating-a-list-of-users-and-profile-page/)
   I decided to follow that and extend the User type rather than create a custom
   post type. Thanks for that tutorial, it was very helpful.
 * For the page I’m working on, I want to be able to select a subset of users, based
   on a Pod field of Company, which is a related field, to a custom category.
 * I tried the following code but I get No users found.
 * $users = new WP_User_Query(array(
    ‘meta_key’=>’_pods_company’, ‘meta_value’ 
   => ‘C1’, ‘orderby’=>’meta_value’, ‘fields’=>’all_with_meta’ ));
 * I tried first using ‘company’ for the meta_key, but after that didn’t work, I
   looked in the database and saw it listed as _pods_company. The tutorial doesn’t
   provide an example so I’m not sure how to select the records based on Pods field.
 * I tried using last_name for meta_key and a valid last name for meta_value and
   that worked ok. So I’m not sure if I need to do something different if I wan’t
   to search for a Pods field?
 * I tried searching the forum for WP_User_Query and came up empty
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fusing-wp_user_query-on-pods-fields%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/using-wp_user_query-on-pods-fields/#post-11381215)
 * Can you clarify what type of field the Company field is? Is it related to another
   object or is it a “Simple Relationship” where it’s just a list of text in the
   field editor?
 *  Thread Starter [Matt Knowles](https://wordpress.org/support/users/aestheticdesign/)
 * (@aestheticdesign)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/using-wp_user_query-on-pods-fields/#post-11381274)
 * Companies is set up as a Custom Taxonomy, just one field, company.
 * Values are hierarchical:
    - Chiefs
 *  - C1
    - C2
    - C3
 *  - Company 1
    - Company 2
    - Company 3
    - Company 4
    - Probationary
 *  -  This reply was modified 7 years, 2 months ago by [Matt Knowles](https://wordpress.org/support/users/aestheticdesign/).
    -  This reply was modified 7 years, 2 months ago by [Matt Knowles](https://wordpress.org/support/users/aestheticdesign/).
 *  Plugin Author [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/)
 * (@sc0ttkclark)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/using-wp_user_query-on-pods-fields/#post-11381279)
 * Unfortunately you cannot reference other taxonomy object fields through the meta
   key/value lookup here. You can reference the Term ID like that though. Try referencing
   the term ID instead of the term name (C1)
    -  This reply was modified 7 years, 2 months ago by [Scott Kingsley Clark](https://wordpress.org/support/users/sc0ttkclark/).
 *  Plugin Contributor [Jim True](https://wordpress.org/support/users/jimtrue/)
 * (@jimtrue)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/using-wp_user_query-on-pods-fields/#post-11446985)
 * Since we’ve not heard back from you on this one, we have to assume the question
   is resolved so we’re closing this ticket.
 * If you’re still having issues, please respond and re-open this ticket or you 
   can join our Slack Chat at [https://support.pods.io/chat/](https://support.pods.io/chat/)
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Using WP_User_Query on Pods fields’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

## Tags

 * [wp_user_query](https://wordpress.org/support/topic-tag/wp_user_query/)

 * 4 replies
 * 3 participants
 * Last reply from: [Jim True](https://wordpress.org/support/users/jimtrue/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/using-wp_user_query-on-pods-fields/#post-11446985)
 * Status: resolved