meta_query where value is equal to given value
You’re almost there — you just need to add the comparison to your meta query: $args = array( ‘post_type’ => ‘product’, ‘meta_query’ => array( array( ‘key’ => ‘artist’, ‘value’ => $artistID, ‘compare’ => ‘=’ ) ) ); https://codex.wordpress.org/Class_Reference/WP_Meta_Query Remember to filter $artistID before accepting it in your query!