There should not be any need to do this.
Even if an ACF Field is using 'return_format' => 'm/d/Y g:i a',
The post_meta value is in YYYY-MM-DD 00:00:00
format.
$date_now = date('Y-m-d');
$args = [
'meta_key'=>'the_date',
'meta_value'=>$date_now.' 00:00:00',
'meta_compare'=>'>=',
];
$query = new WP_Query( $args );
Edit: I’ve noticed some discrepancies in this, the value may be in Ymd
. When in doubt, check the data. You can find the post_meta by looking up the post_id
in the wp_postmeta
table.
Related Posts:
- ACF Relationship Field Search Filtering [closed]
- datetime picker, timestamps and meta queries
- meta_query with array as value
- Use meta_query to display events by date in custom field
- If two first numbers exist in wp_meta_query value
- WP_Query meta_query >= date
- ACF Date Based wp_query
- Custom query based on meta key – Reduce three states to two in results?
- What is the random string I am seeing when I use get_query_var?
- Any number in meta key (wp query)
- 2 weeks ago from meta query meta value
- WP_Query with meta_query dosen’t return results
- Custom query filter by ACF date custom field
- Order WP_Query by meta_key priority when ‘OR’ relation used for multiple meta values
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- WP_Query, ACF field and array
- Pre get posts sort by meta key returns no results if meta key does not exist
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- datetime picker, timestamps and meta queries
- Get posts meta_query by repater field
- How can I modify standard search query to include also ACF custom fields values?
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Get posts using multiple values from ACF checkbox as meta query wordpress
- How do I subquery with custom meta fields?
- Use value from meta key array for use in WP_Query
- WP Query Args – Title or Meta Value
- Meta query with string starting like pattern
- Does tax_query really beats meta_query in all situations?
- Query WooCommerce orders where meta data does not exist
- Execute a large WP_Query with many “AND” Meta_Queries?
- Using WP_Query To Get Posts Randomly From today
- Query all posts where meta value is empty
- WP_Query min and max values
- WP_Query using meta_query with relation OR and orderby meta_value doesn’t work
- querying with custom meta field with meta_query
- Order by two meta keys
- multiple meta key but get server load is very high
- A WP_Query that will look for posts after 2 weeks ago OR with a certain meta value
- Wp_query order by multiple custom fields?
- Minimising number of queries on a page when using Advanced Custom Fields
- How to show recent and upcoming birthdays using meta_query
- ACF Relationship + WP Template Parts
- Using WP_Query and WP_Meta_Query Outside of WordPress
- WP_Query on custom field and order results
- How To Fix WP Query Returns Results But Shouldn’t?
- Tax query clause inside a meta query clause?
- Include custom field in Ajax search WordPress
- Optional Meta Query
- How do I make a meta_query OR relation work? [closed]
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- Meta_query on same meta key, with diffrenct values
- Can we return all category (not post) with Custom Query Filter? [closed]
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Array as ‘key’ in WP_Query
- How to provide meta_key array to wp_query?
- Searching for meta_key returns 0 posts
- ACF accessing a field from the query, but not in post
- How to set up hierarchical relationships without using plugins / meta query
- Meta query compare for ID’s greater than specific ID
- Is it possible to add relation between meta_query and tax_query?
- Get a list of ACF Repeater-Fields as array
- Show single posts date, in a page of posts
- WP_Query Class custom field parameters
- meta_query where the meta value is not the post title
- Multi-layered WP_Query
- Oxygen Repeater Advanced Query
- WP_Query for distinct meta values
- Group Product Types
- How do i create a custom post query when the meta value is an array?
- WPQuery Date and ACF
- meta_query with meta values as serialize arrays
- Woocommerce Get Orders By Meta Value
- meta_query is overriding default search
- Multiple WP_Query args combinations according to post type
- WP Query by variable custom field
- WP_Query multiple value not working
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- WP_User_Query Orderby Not Working
- Unusual high query of user meta data
- Very slow query generated getting meta data from posts
- WordPress Query optimaization for slow query
- How to query wordpress with array of meta_values?
- Limit default Search query to post_title
- Meta query doesn’t remove placeholder escape before query
- WP Query Meta Query
- Query custom meta value – post view and date meta
- Custom WP_query and integrating into theme file
- WP_Query – show posts where meta value and user_email match
- Best way to Order Post in Home without a plugin
- WP_Query using meta_query with LIKE doesn’t return what it should
- Return a single custom post from multiple meta queries
- query post based on comparison
- Including ‘cat’ => $cat breaks meta_query
- Query string form $_GET[‘value’] is not working as meta value in wp_query
- WP_Query orderby not working on custom post_type
- 294 Queries on Mainpage of WordPress
- How to get all post_id and meta_value using meta_key in wp_postmeta table
- WP Query – Show custom posts only if user contain some user meta
- Showing Counts on Comment List with Custom Query