Terms are grouping mechanism. Query logic for them is mostly limited to matching or not matching, which makes you use huge arrays of many possible values in your case.
While year is passably a group (might or might not make sense) the price is most definitely not. Would you shop in store where items are organized in isle by price? Isle with all $1 items, isle with all $2 items, and so on?
Discreet individual values are firmly realm of post meta. Meta also allows much more flexible queries, such as BETWEEN
for your use case.
I am not sure why do you consider it “not well optimized”, but it would certainly be better place to start for range queries than terms.
Related Posts:
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- Query set using tax_query with relation ‘OR’ modifies category object?
- Modify users.php query with multiple taxonomies
- List only parent attributes on woocommerce admin atrributes page
- Why pagination is not working with tax_query param?
- Order WordPress Query by Custom Field While Still Using Tax_query Argument
- Multiple terms not working on taxonomy
- Find all posts via SQL beginning with A of type B
- How to display SQL query that ran in query?
- Custom query_var causes displaying posts archive on front page
- What is the most efficient way of implementing a favorite post system?
- Why does get_the_time(‘F j’) return November 30 for all posts?
- Query by one meta_key and sort by another (possibly NULL value)
- Query & Sort Comments by custom comment meta
- Count user posts by user ID, Post type and Post status
- is_archive() doesn’t work on public query var archive pages?
- How to count get_users query?
- cron job to auto delete posts of a specific post type older than x days
- Possible to get posts from multiple meta keys/values in a single query?
- get complex results set according to category structure
- Difference between fragment caching and wp_cache
- How to display all posts with today’s same month and day only?
- Two differents queries in archive page
- Empty tax_query array returns an empty array
- Select User by Joining Multiple Meta Value Results
- How do I find if a page has a template?
- Show featured image as background image from postQuery
- Using $wpdb->update but confused on the WHERE in and SET
- Include posts from feature category in pre_get_posts
- You have an error in your SQL syntax – Help with query
- How to retrieve elements from another table in a SQL query?
- Make one query for adding entries to database
- add_query_arg() and empty variables inside
- Query Strings and Woocommerce
- Style Post Differently In Query
- WordPress post type “event” query string fix?
- Order posts by custom field DATE value
- ACF: how do I get the fields and its values of a specific group?
- order one custom post type by modified time of another post type
- Form redirect with query vars to page
- is_search called incorreclty
- Function to delete a post, it’s children and it’s grand children (half way there already)
- Nested loop : wich way/order?
- Custom query AFTER rss fetch_feed not working
- Dynamically adjust single-posttype.php query, based on current taxonomies
- list all categories that have a certain word in title
- Passing parameters to a static front page
- Use mysql_query instead of $wpdb query
- Post with certain term and without any term
- Custom Query – Based on user input
- How to reset usual $query on search page to push custom $wpdb query there?
- Order by meta value pro first then meta value free in my search function
- Change the destination of the URLs in post.php
- Page with custom template make get request to a custom route – Pseudo code
- get_users with array as meta_value
- How to exclude posts for current user
- How to delete all posts, categories and tags from WordPress database
- Valid SQL query return empty
- mysql query – how to escape apostrophe?
- Query the WordPress database to get data together with replaced information
- exclude pingbacks from wordpress SQL query
- Query for Custom Post Type UI Does Not Loop All the Post
- wp_posts query slowing down my website
- Get the_field of Advanced Custom Fields in a custom query [closed]
- Advanced Custom Fields – Relationship post foreach query
- How to manage a particular “order by” for get_search_query()?
- How do I query for posts by custom meta and those that have been stickied?
- Select min/max meta from query
- Tax_Query using WP_Query not working
- WordPress query unique post meta – finding all of one value without duplicates for a drop down
- Exclude in get_pages() based on meta field
- SQL to Query the db and return all posts and it’s metas
- Query Post interferes with Pagination
- How to do a sql like query on serialized data of user meta data
- My archives page won’t sort posts by month
- Trouble migrating custom post types from non-wordpress cms
- How to get all images in Media Gallery with pagination?
- Attachment page tag queries & posts not found
- Not getting input from get_query_var
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Create a new post on a specified publish date via link?
- Exclude Posts from a Widget
- New custom post type entries are not sorted correctly in admin using pre_get_posts
- Query String for the WP_QUERY parameters
- Counting And Monitoring How Much Queries My Script Used
- $wpdb query for price in custom field value
- Custom query for tag and custom tag from 2 post type
- Sorting of coupons in the right way
- List posts of terms but exclude one term
- search.php is not generating the right results
- excludeCat function reverses order of blog posts
- Run search query again without pagination gives no results?
- WP_Query orderby meta key/value suddely stopped working
- How to get one result using wpdb class?
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Delete query won’t run
- Where can I find the SQL to get the most used information by wordpress database?
- WooCommerce Total # orders [closed]
- Modify a query using both a text field and a true/false AFC field
- How to figure out correct wp_options to have autoload=’yes’