• Resolved haagendazs1

    (@haagendazs1)


    Hi I’m basically trying to query posts that don’t have a specific custom field. For example, I have a website about books, where each post is a review about a specific book. Each post should have at least 3 custom fields (Genre, Number of pages, and Difficulty). So an example post, say for “Harry Potter” would have Genre as “Fiction”, Number of pages as say “650”, and Difficulty as “Easy”. Now sometimes I forget to put in one or more of these custom fields and it messes up a bit of the post, but I don’t always catch it.

    Is there a SQL query I can execute that would select all the posts that are missing a category? Like a SQL version of “Select posts that don’t are missing one or more custom field keys called Genre or Number of pages or Difficulty”.

    Thanks!

  • The topic ‘Query posts that are missing a custom field’ is closed to new replies.