You can do everything you need using the search parameters allowed in WP_Query — except searching in the post title only. In order to do that, see this answer.
Make sure to look at the taxonomy and meta subqueries allowed in the args passed to WP_Query.
EDIT: Since you need to select using OR, you have 2 options — you could run 2 queries and merge the 2 post arrays afterwards, or if you are more concerned about performance, you can use a custom query and just execute the SQL you wrote above. Use the global $wpdb object and the function $wpdb->get_results(). In order to make your query not return duplicate results, you should be able to use SELECT DISTINCT.
Related Posts:
- Nested meta_query with multiple relation keys
- “tax_query” parameter not working with WP_Query
- How do I exclude a custom taxonomy from the post loop
- Custom Taxonomy and Tax_Query
- Using WordPress to make a “Product Search” type navigation drilldown
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- Including all terms in wordpress tax_query
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Advanced Tax Query
- why do drafts return as part of wp_query?
- cannot get multiple loops using tax_query
- Hiding taxonomies with no children WP_Query & tax_query
- How to display Related Posts based on number of taxonomy terms matched
- Set tax_query conditionally with new WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Using WP_Query and Query_post for the loop?
- How to do a particular wp_query taxonomy search
- WP_Query tax_query – Show results if child has parent X
- how to use tax_query to apply both terms or one if one is empty
- custom post type and a “sticky” position taxonomy
- WordPress hiding posts without content on custom taxonomy query. How to solve?
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Advanced AND tax_query in sidebar with 2 taxonomies
- How to limit posts to 1 from each term with tax_query?
- WP Query Conditionally query meta and taxonomy
- Complex Taxonomy scheme
- Adding a language rule and displaying posts with a custom taxonomy term on its archive page
- Exclude taxonomy term from all loops, but having it on widget
- Why can’t I use an array of term slugs in WP_Query?
- wp_query not resetting, last post hanging
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- WP_Query parameter conflict
- Problem with wordpress pagination
- How to write sql query to get the posts from a custom taxonomy term name
- Tax Query only returns for the first of several terms
- find custom post type post by searching its custom field with my string
- tax_query: Don’t show posts with parent term when they have a corresponding child term applied
- one post per term taxonomy
- How to print term name inside wp post loop
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- Is it possible to add relation between meta_query and tax_query?
- tax_query (if the terms are empty)
- Create alphabetical Pagination for custom taxonomy?
- Loop through custom taxanomy in post and display custom fields from posts
- Custom arguments in WP_Query
- How to restrict search on a certain page to only return results against custom taxonomies?
- Show single posts date, in a page of posts
- Wp_query…a type of term a different div
- check if a taxnomy queried in $wp_query?
- Taxonomy.php how to show post only in current taxonomy with wp_query?
- how to access the $query variable inside taxonomy-xxx.php template file?
- Query custom taxonomy for category including children
- Why doesn’t my WP Meta Query return any results?
- Proper way to create taxonomy queries
- Get current page term title to use in WP_Query
- passing moree than one value of slugs in taxonomy using variable
- WP_Query Class custom field parameters
- Insert taxonomy slug into loop class
- Custom query looking at multiple custom fields and properly sorting
- Using Custom Taxonomies to organise products – struggling to call a correct list
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- Get Posts Related to Category By category id or slug
- Display just the Post’s parent Category, not child
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Facing problem with tax_query results
- How do i create a custom post query when the meta value is an array?
- Show posts from two specific category in WP_Query
- Tax query get first product with attribute value in pre_get_posts
- ElasticPress is (aparently) messing with my search filters
- WP_Query for a taxonomy value OR a custom post type meta field
- How do I stop the same post showing multiple times in a archive?
- Group posts in a category based on tags in custom taxonomy
- Query for current post
- How to search through all child taxonomies using WP_Query?
- Custom query to retrieve oldest post and retrieve others with date interval
- Tax-query on taxonomy doesn´t work
- how do you pull data from two taxonomies?
- Use WP_query to match post types based on custom field values
- list all post who have mutual taxonomy as current taxonomy!
- Getting Custom Posts with Custom Taxonomy
- Optimal way to make tags in tax_query optional?
- WP Query tax_query not returning posts
- My entry results are not consistently alphabetized
- Not able to get my custom search result using meta_query and tax_query together?
- Orderby query does not work for custom fields even with meta query
- WordPress search form and search result through ACF field in custom taxonomy
- Custom WP_query and integrating into theme file
- WordPress Multiple Taxonomy Query
- How to show one post content in another post content which has same terms?
- How can I get all the posts that are related with a specific taxonomy term?
- How to combine nested tax_query logic with other nested query logic?
- tax_query not working for taxonomy slug
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Custom query for tag and custom tag from 2 post type
- How to get hierarchical number of custom taxanomy
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- WordPress custom post type