After a full investigation and a lot more debugging and code tempering I found out that using “date” as a meta field name generate a lot of “confusion” inside the wordrpess query itself as wordpress confuse the meta_query “date” field with the “date” itself, to avoid all this the solution is simply changing the name of the metafield from date to meta_date, doing that makes all the query on the field work as intended!
Related Posts:
- Using meta_query, how can i filter by a custom field and order by another one?
- meta_query for keys that aren’t yet set
- WP_Query orderby custom field then post_date in one query
- Filtering a WP_Query meta_query by numeric values isn’t working
- Querying custom post type with 2 custom fields (date-range)
- How Can I save multiple records in same meta key?
- order by meta_value serialized array
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- How loop through posts based on custom fields
- Display custom post types with custom date field value (before today) & order by custom date field
- Filtering by Post Meta Custom Fields – Performance
- WP_Query: include custom post type only with specific meta value
- Returning a list of custom post types excluding those without a specific meta_value
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- wp_query check if integer exists in custom field’s array
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Meta Query Not Returning Output Despite Having Matching Values
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- Meta Query posts not showing on ending date of custom field
- Admin Custom Meta Box – Pull Last 5 Posts from Custom Post Type
- How to Output which matched meta_keys were found from custom_type_posts?
- Possible to filter custom post type with multiple meta data?
- filter search custom field query
- How to let users choose where to search for posts?
- Query based on custom fields start and end date
- Getting a custom post’s custom field based on another custom post’s custom field select
- Custom Query: If One Post Object Field Value Is The Same As Another
- order the meta query results by 2 custom fields
- Using OR relation in meta_query to check for a value before sorting by another
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- Meta query and compare “!=” not working as expected
- Orderby if between two meta fields
- Show posts from WP Custom Post Type selected from a field in a metabox
- meta query multiple values for the same key
- Sort custom post archives by a meta value from a different custom post type?
- Custom post types – meta_query: search lesson which starts sooner
- Meta_Query refuses to return results
- Sort loop by custom field from different post type
- Meta_query by date for Events archive
- Query events post type after current date and timezone
- Selecting posts older than the current Unix epoch timestamp
- Unable to get the upcoming events for custom post
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- loop through custom post-type with two meta_keys
- Querying meta values within an array
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Get Posts ordered by a date custom meta field
- Check for custom field value in different post type than current one and do something
- Function to Compare CPT Post Custom Value with Default Posts CF Value
- Advanced search form with filters for custom taxonomies and custom fields
- How do I implement custom fields without using any plugins?
- Custom post metadata not appearing in public API
- Query for custom post type objects in a taxonomy and with a meta value
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- Create a post in custom post type using field in registration form after users submit form
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- How to structure a site with product variations pages?
- Creating a Custom Post as a repository for theme constants
- How do I associate a custom post type with another through a taxonomy or storing an ID in a custom field?
- Meta query for custom post type ignored in main query
- Show custom post type relationships by taxonomy
- get_post_meta not working on publishing
- Query custom post type with ACF Date
- Add custom field in comments form
- Order Custom Post Type by Custom Field Value
- Hierarchical custom fields
- Fields for different parts of a page
- How to display custom field value on page?
- add post meta value
- Adding Template Post Content
- How to display a WordPress Custom Field only on a specific day of the week?
- CPT Repeatable Fields + Undefined Index
- Filtered by a custom field, ordered by another
- Sorting by meta_key different to search criteria?
- Search CPT Title AND Meta
- Save Custom Fields
- Custom field only on custom post type?
- Display Posts that fit a certain criteria on Category pages
- Sort custom post column by generated value?
- meta query condition don’t work
- Filter posts by their related field’s custom field
- How can I register multiple custom post fields to json?
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- sorting in wp query based on custom field value
- PHP Notice: Unidentified index
- check_admin_referer not working in custom meta box for custom post type
- WordPress loop add heading before first of type
- How do i create user accounts from custom posts that have email addresses
- Best way to use Category & Custom Fields?
- Is it good practice to search for custom posts based on custom field values?
- Custom post type with custom fields enabled, is there a way to set a default group of fileds?
- Storing/querying custom date data
- Custom Post Meta on a Different Page?
- Creating post custom field text area
- querying to custom field over ACF REST API
- Display ACF object field data using Elementor Custom Query
- Sortable admin columns ordering from custom fields isn’t combine com search and Dropdown filter
- WordPress custom field sorting, weird behavior: the latest post is at the end
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes