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

How can I change the order of posts in the admin dashboard, so they display alphabetically according to title, rather than latest first?

share|improve this question
up vote 7 down vote accepted

If you don't wish to always click the "Title" column to sort your posts by title, you can place this code in either your currently active WordPress theme's functions.php file, or within a plugin. This will automatically always sort your posts for you, so you don't have to click the title column every time.

You can use this for setting default sort order on post types.

/* Sort posts in wp_list_table by column in ascending or descending order. */
function custom_post_order($query){
        Set post types.
        _builtin => true returns WordPress default post types. 
        _builtin => false returns custom registered post types. 
    $post_types = get_post_types(array('_builtin' => true), 'names');
    /* The current post type. */
    $post_type = $query->get('post_type');
    /* Check post types. */
    if(in_array($post_type, $post_types)){
        /* Post Column: e.g. title */
        if($query->get('orderby') == ''){
            $query->set('orderby', 'title');
        /* Post Order: ASC / DESC */
        if($query->get('order') == ''){
            $query->set('order', 'ASC');
    add_action('pre_get_posts', 'custom_post_order');

You can use some of these example conditions...

/* Effects all post types in the array. */
if(in_array($post_type, $post_types)){


/* Effects only a specific post type in the array of post types. */
if(in_array($post_type, $post_types) && $post_type == 'your_post_type_name'){


/* Effects all post types in the array of post types, except a specific post type. */
if(in_array($post_type, $post_types) && $post_type != 'your_post_type_name'){


If you wanted to apply this sorting on ALL post types, regardless of whether or not they are "built-in"...

Change this: $post_types = get_post_types(array('_builtin' => true), 'names');

To this: $post_types = get_post_types('', 'names');

share|improve this answer
Is it ok to use within the function rather than check before the action if ( ! is_admin ) { return; } – drtanz Sep 30 '12 at 21:07
I suppose you could do that. – Michael Ecklund Oct 1 '12 at 15:13

Ah, click that little title thingy to toggle alphabetical sorting....

enter image description here

share|improve this answer

You can always add to the address :


share|improve this answer
Why the post_type is custom one here, give OP a generic answer.. we can order the title in the order by clicking on the Title column – bravokeyl Jun 21 at 9:13

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.