WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the correct way to add a custom filter (a dropdown box in this case) to the admin user list (wp-admin/users.php)?

There are no filters or actions that I see to hook into that would allow me to output a select box.

I know I can inject it via javascript, but I'm hoping there's a way to do it on the PHP side.

I am planning on using the results of that filter int as outlined here: How to search all user meta from users.php in the admin

share|improve this question
Looked at the code...you're right...there's no actions or filters in the whole process of generating that table view. The only one is for the role links (the little ones top left). – wyrfel Feb 24 '11 at 7:44
Maybe there is some overarching filter that passes in the entire page output and I can add it via regexp? – John Feb 24 '11 at 14:59
up vote 1 down vote accepted

Actually found a potential way (with WP3.1), but it's a bit more involved than using filters:

Since WP3.1 now uses the WP_List_Class to generate the admin pages, you can create your own My_User_List_Table class, inheriting from WP_Users_List_Table and in that class override the extra_tablenav() method. In your own method you duplicate the code from WP_Users_List_Table::extra_tablenav() and add your own stuff.

Then you create a duplicate of wp-admin/users.php, modify it to use your class instead and modify the users menu entry in the admin navigation to call your duplicate instead of wp-admin/users.php. I'm not sure if WP3.1 now comes with easier methods to do that then the hacky solutions necessary for WP3.0.

Unfortunately, all this new WP_List_Class stuff comes without good action or filter hooks, it would have been so easy had they added an apply_filters() call to _get_list_table(). Grmpf.

share|improve this answer
You should never advise to change core files, man. That's just wrong... – timocouckuyt May 31 '15 at 14:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.