WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set a custom column for date in admin, but the sorting is not working, when I click to sort the dates are jumbled up and not sorted correctly. This is the sorting function Im using

function sortable_columns() {
    return array(
        // meta column id => sortby value used in query
        'publishdate' => 'date', // e.g. 1344964575            
} add_filter( "manage_edit-post_sortable_columns", "sortable_columns" );
share|improve this question
up vote 2 down vote accepted

This tutorial from WPTuts+ will do the trick ... Quick Tip: Make Your Custom Column Sortable

In a recent article by Claudio Simeone, he demonstrated how you could add extra columns to your post, or custom post type, admin screens (or remove existing ones). In this quick tip I build on that by showing you how to make your newly created columns sortable.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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