Home Forums Backend Issues (wp-admin) Search relationship on custom field Reply To: Search relationship on custom field

  • I’m assuming that you’re getting no results.

    The reason is that even though you are putting an OR in your meta query it doesn’t have any effect because when WP runs the query it is looking for the search value in the title AND in the post meta value.

    I believe this question has been asked before. As far as I know there isn’t any way in WP to do a query where something can appear in the title or in a post meta field. You’ll either end up getting everything or nothing.

    The only way to successfully do a search like this it to write your own SQL queries using $wpdb. It’s a limitation in WP_Query.