Valueless custom field appears in meta_key query in Wordpress

Asked

Viewed 54 times

0

When creating any Custom Field with the ACF plugin, even if I don’t add any value to it in a post, when making a query via meta_key these posts that have no value are displayed.

For example, I create a post and in a meta_key I add an expiration date. If comparing this date and it is less than the current date, it automatically expires. It turns out that posts that I do not add expiration date, also expire, as they appear in the query by meta_key with reset value.

What I wish is that this worthless meta_key is not part of the query. It is possible?

  • ao fazer uma consulta via meta_key, what is this query? It has code?

  • i didn’t understand your question, but I thought of this plugin: https://wordpress.org/plugins/post-expirator/ will help you?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.