Support » Fixing WordPress » Querying the `wp_usermeta` Table

  • Resolved pursuit


    I am trying to figure out how to extend my plugin so that it queries the wp_usermeta table when I search for users in the Dashboard, i.e. on the “/wp-admin/users.php” page. I am thinking that I can use the ‘user_search_columns’ filter to hook into the search, modify the columns that the search queries, and get the desired results. However, I have not yet been able to get that approach to work.

    Does the ‘user_search_columns’ hook query the wp_usermeta table? Do you have any suggestions for how to improve upon this approach or any suggestions for different approachs that I could take that would help me to accomplish my goal?

    For your reference, here are links to the Codex for the ‘user_search_columns’ filter and to a pastebin for my code:



Viewing 1 replies (of 1 total)
  • Thread Starter pursuit


    I was able to write a MySQL procedure to address the problem. You can find the body of the procedure at the URL below. You should be able to extract the query from the procedure’s body if you want to run the query directly.

    Pastebin for the body of the MySQL procedure

Viewing 1 replies (of 1 total)
  • The topic ‘Querying the `wp_usermeta` Table’ is closed to new replies.