Problem with query loop

Hi everybody, I’m struggling with a query loop configuration which, in my mind, seemed to be very easy but it doesn’t work in any manner.

I created a CPT for courses using Meta Box and added some custom fields inside. One of these custom fields is a switch that is needed to identify a specific kind of course.

Being a switch type it returns just 2 values, 0 or 1 (so that’s why I thought it should have been easy to configurate); what I’m trying to achieve with the loop is getting a list of all the courses except the ones having the value “1” in that custom field but, obviously, it’s not working at all.

The name of custom field is “corsomaster” while the name of CPT is “corsi”.
Could you please help me understand what I’m doing wrong?

Thanks in advance to everybody.


  1. Change Relation to OR
  2. Add one more meta Key corsomaster, compare NOT EXISTS.
  3. Keep also your original and try if it works.

I guess the problem might be that your CPTs does not have any corsomaster meta data assigned, so it has troubles comparing.

Let me work if it helped!

Hi Divadyx,

thanks you very much for your reply but finally (thanks to the support of the Facebook community) I found out where the problem was: the query loop configuration was correct but I used a Metabox custom table and I discovered that it can’t be queried by WP Meta Query.

Thank you once again for your support.