You have no need for three states. Logically, you have “set” and “unset”. Don’t complicate things. When you check the box, add p3_comment_status
. When you uncheck, remove (delete) the key. If you do that, all you need to do is use EXISTS
/NOT EXISTS
. That makes for a much simpler, and faster, query as a bonus.
You have not posted the code that saves your data so a detailed answer is not possible but delete_comment_meta
is probably what you need.