I am trying to sort posts by their custom field value, which is a date in this format:

9 August 2012, 7:18 am

        'orderby'  => 'meta_value', 
        'meta_key' => 'wprss_item_date',
        'order' => 'DESC'

Do I need to do some conversion before that can work?

1 Answer 1


Your date should be stored in descending units, like yyyy-mm-dd hh:mm:ss for MySQL to be able to sort on the field.

See the MySQL docs for Date, Datetime, and Timestamp data types.

Your Answer

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

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