I'm attempting to display all customers which have a meta data of having a specific value.

So during my situation, I've got a custom user meta data area known as isblogger, using the options good or bad. So I must list customers which have the isblogger value as yes.

Presently this is actually the code I've that's dispaying all customers

global $wpdb

$authors = $wpdb->get_results("Choose ID, user_nicename FROM $wpdb->users") foreach($authors as $author) title etc...

Any help on this is fantastic and far appreciated.

You need to add Where condition isblogger='yes'

Perhaps you have found a solution for ongoing this type?


$authors = $wpdb->get_results("SELECT ID, user_nicename FROM $wpdb->users"); 
 foreach($authors as $author) {  
        $auth_id = (int) $author->ID;
        $meta_isblogger = get_usermeta($insc_id,'isblogger');
        if ($meta_isblogger == 'yes') { echo 'you got it';}