Order by custom field date?

There are similar posts on this site about the same topic, if you look around. But here is your answer: To make this work you need to change your date format.

You can sort alphabetically, or numerically, not calender-merically. The only human date format that orders correctly is YYYY/MM/DD. The separator are optional and shouldn’t matter. Your format is never going to sort the way you want.

Alternately, you could store your dates in Unix time format and convert them to ‘human’ when you display them, which is what I’d do.

You could also write your own function to sort things but you will need to query and then sort, which is extra overhead.

Leave a Comment