Sort Posts in Admin by Meta Value

Sometimes we need to display some meta information of a post in the admin listing. Usually it is handy to also make this information sortable so it is more useful to the client.

Here is some example code of how that is done.

You will need to update the ‘post-type’ to the post type you want to edit and the ‘my_meta_key’ to the meta key you want to sort by.

Big thanks to Rachel Carden over at wpdreamer.com.