Support » Plugin: Pods - Custom Content Types and Fields » Using WP_User_Query on Pods fields

  • Resolved Matt Knowles


    After coming across your tutorial at 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_value’ => ‘C1’,

    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 to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Scott Kingsley Clark


    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


    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 2 years, 9 months ago by Matt Knowles.
    • This reply was modified 2 years, 9 months ago by Matt Knowles.
    Plugin Author Scott Kingsley Clark


    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)

    Plugin Author Jim True


    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


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using WP_User_Query on Pods fields’ is closed to new replies.