Home Forums Backend Issues (wp-admin) Relationship field not searching custom fields Reply To: Relationship field not searching custom fields

  • The search in the relationship fields uses the standard WP ‘s’ parameter for WP_Query If you want to extend the query to also search custom fields then you’ll need to modify the query.

    I would start here

    And I’d take a look at at the parse_search() function in /wp-includes/query.php. It’s on line 2112 in the current version of WP.

    I’m not sure you can do this by just adding a complicated meta query. You may need to hook into where the query is done and alter it there, you may even need to build a completely custom query and to the db query yourself.

    There are some plugins available that will alter searches, one of them is, but I’ve seen this plugin cause a site with a lot of posts and custom fields to time out.