in Tips and Tricks, WordPress

Search User by Display Name in WordPress Sitewide

In wordpress in backend or if you use wordpress user query ‘WP_User_Query’ by default it will not search by display_name even if you add display_name in “search_columns” field of WP_User_Query
So, this can be achieved by this small filter https://gist.github.com/manchumahara/9910185 (after add this code now if you search in your wordpress admin panel for user with their display name it will work)

ref: https://codex.wordpress.org/Class_Reference/WP_User_Query