Select all products that have a custom field ‘is_new’ set to ‘Yes’

You’re attempting to do a “taxonomy query”. This is for things like tags and categories. Custom fields are stored as meta, so you need to do a meta query.

$loop = new WP_Query( [
    'post_type'      => 'product',
    'posts_per_page' => -1,
    'meta_query'     => [
        [
            'key'   => 'is_new',
            'value' => 'Yes',
        ],
    ],
] );

There’s a few other differences to take note of:

  • From your screenshot, the value for yes is Yes, not YES.
  • Taxonomy and meta queries need to be an array of arrays. See how my meta query is an array inside another array.
  • Since it’s not a taxonomy query, we use compare instead of operator, but the default value for that is =, which we want, so we can omit it.