I have dates stored in the format d-m-Y, and i want to display any posts that are in the past, before today.

    $args = array (
        'posts_per_page'=> 8,
        'paged'=> $paged,
        'meta_query' => array(
            'key' => 'auction_date',
            'value' => date( 'd-m-Y'),
            'compare' => '<',
            'type' => 'DATE'

This doesn't seem to work and i can't figure out why. Any suggestions would be much appreciated.

1 Answer 1


ACF stores it's dates in Ymd format, this is why i couldn't compare.

Make sure your date is in Ymd format when you compare it against an ACF datefield.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.