in Development

Listing authors alphabetically in WordPress on the Write Post page

We did an installation of WordPress for a company with more than 168 authors. It was a massive undertaking. For some reason WordPress 2.0 doesn’t list post authors alphabetically by default. We asked on the WP support forum how to change this and someone kindly replied with an answer.

Make a copy of wp-admin/admin-db.php. Then around line 37 in that file, where it says:

$authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable)" );

change it to:

$authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY user_nicename" );

Changing core WordPress files is not normally recommended so do so at your own risk! Originally from the WordPress Support forum. Thanks to MichaelH.

Write a Comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.