The only option you have is to write your own SQL into the posts_clauses
filter, where you get an array of the JOIN
, WHERE
, ORDER
, etc. clauses that you can alter, add to, remove, etc.
One MAJOR MAJOR note on this, is ALWAYS use the global $wpdb
‘s prepare
function, which will sanitize all your lovely datas. You don’t want to be allowing any type of injection through your search term custom queries. 🙂
Related Posts:
- tax_query will produce nothing
- Multiple, nested tax_query relation
- Can’t make a tax_query across different post types
- How to write a Tax Query that matches all terms in an array?
- using multiple terms in tax_query
- in_category() and tax_query with custom post type
- OR for a single taxonomy in a tax_query
- simple tax_query intersection
- How to set `tax_query` with `query->set()`
- tax_query will produce nothing
- Tax query: exclude posts if ONLY a certain term is applicable
- Nested meta_query with multiple relation keys
- “tax_query” parameter not working with WP_Query
- Multiple relationship for multiple tax_query in WP_Query
- WordPress tax_query “and” operator not functioning as desired
- tax_query in get_posts() not working?
- Query posts by custom taxonomy ID
- Custom Taxonomy and Tax_Query
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- When tax_query used, results disappear (0 =1 produced)
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- Escaping WP_Query tax_query when term has special character(s)
- Does tax_query really beats meta_query in all situations?
- pre_get_posts with tax_query causes empty result
- Including all terms in wordpress tax_query
- Tax_query terms ID’s using variable
- The Operator “NOT IN” Does Not Work In tax_query
- How to tax query X number of posts related by tag first, then by category if not enough in tag-related
- Why is my WP_Query not working when tax_query terms are an array?
- get_terms with posts that have a different taxonomy with term x
- template_include for search.php makes WordPress think its on the home page
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Hidden woocommerce products still showing up in search results [closed]
- search query within custom taxonomy term, post title and meta field
- How to create a WP_Query to search the Title or Tag?
- Order posts by (hierarchical custom) taxonomy terms and term children
- if wp_query taxonomy term have posts
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Tax_query not working on multisite
- Query set using tax_query with relation ‘OR’ modifies category object?
- Terms with more than one occurrence have current-menu-item class in menu
- tax_query not working on main query
- How to combine tax_query and date_query in WordPress
- Specify number of posts in my ‘tax_query’
- Problem with get_posts, tax_query and counting the number of posts
- Combine tax_query and meta_query in WP_Query
- Count number of posts which exist in 2 taxonomies?
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- Using tax_query reverses my post_type argument in a custom WP_Query
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Ordering Posts with Custom Taxonomy Terms Array
- Find all product that contain terms with %keywords% in WP_Query
- List taxonomy / category count showing list published posts only
- Get term by custom term meta and taxonomy
- How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero
- tax_query: What to pass when I want to have all terms?
- why do drafts return as part of wp_query?
- tax_query shows no results if nothing is selected
- WP_Tax_Query with post_tag not working
- get complex results set according to category structure
- WP_Query tax_query on ACF post_object
- Dynamically tax_query terms
- WP_Query tax_query problem
- How to add terms to my tax_query based off of the current post
- Query for custom post type objects in a taxonomy and with a meta value
- How to output content based on same custom taxonomy?
- Query all posts in a given taxonomy
- Change default ordering of taxonomy terms – pre_get_terms
- Woocommerce change tax rate programmaticly
- Display related products with custom output
- WP_Query with tax_query, order by most ‘matches’
- tax_query OR with empty result returns all posts
- How do I sort posts by custom taxonomy?
- WP_Query, tax_query and term_meta: How to?
- Is it possible to dynamically get queried term AND taxonomy?
- Empty tax_query array returns an empty array
- pre_get_posts Tax Query not working for custom author page
- How can i simulate “taxonomy__in” in query?
- tax_query returning all posts instead of selective posts in WP_Query
- Use both meta query and tax query
- Get pages only with a specific taxonomy
- How to add autocomplete to custom taxonomy for CPT
- pre_get_posts: using tax_query only for certain post type
- Get list of terms that have posts in another term
- Custom taxonomy query not working with switch_to_blog
- pre_get_posts Remove tax_query Completely
- tax_query: Order by slug?
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- ‘wp’ action hook not firing in admin and login?
- Query custom post type by category slug
- Meta Query relation “AND” not working
- Taxonomy archive showing no results
- Tax query clause inside a meta query clause?
- ?cat=-1 Indexed Versions Of Homepage
- Nested tax_query that allows specified categories OR tags, but NOT other categories
- How can I add multiple ‘tax_query’ arrays via a loop?
- Get taxonomy parent using child slug (from merged taxonomies)