Posted on August 31, 2019Categories Programming, WordPressTags , , ,   Leave a comment on WP_User_Query Inverse (NOT) Search

WP_User_Query Inverse (NOT) Search

It took a LOT longer than it should have to build an efficient query for WordPress users today. The query — an WP_User_Query INVERSE search. The list I was trying to generate was based on two things: – All users with a meta_key field ‘account_status’ containing the status ‘active’– EXCLUDE all users with a nicename ending with “at_slp_dot_guru” Turns out this is a LOT more difficult than it should be due to shortcomings in the WP_User_Query class. The solution that … Continue reading “WP_User_Query Inverse (NOT) Search”