This solution was last tested on WordPress 4.1.1 in March 2015.
This solution was tested on WordPress 3.1 running on IIS7 and IIS 7.5. It will work on WordPress 3.1.1, on 3.2.1, and on 3.5.1. This solution was just tested on WordPress 3.8.1 and works very well.
This solution adds a new column to your admin user page, and makes it sortable (optional).
Here are the steps.
-01- Find wp-admin\includes\class-wp-users-list-table.php and make a backup copy of the file.
Call it class-wp-users-list-tableORIG.php.
-02- Open
wp-admin\includes\class-wp-users-list-table.php
in your favorite editor.
-03- Find line
function get_columns() {
-04- Add a new line of code
‘user_registered’ => __(‘Date’),
after email field.
-05- Find a very last instance of
$r .= “<td $attributes>”;
-06- Insert 3 new lines of code between words break; and default:
case 'user_registered': $r .= "<td $attributes>" . mysql2date( __( 'Y/m/d H:i' ), get_date_from_gmt($user_object->user_registered)) . "</td>"; break;
[I would love to hear a recommendation on how to make this date conversion string much shorter.]
-07- Save and test your admin user list page now. You should see a new column in there.
Next two steps are optional.
-08- To make this new column sortable find
function get_sortable_columns() {
-09- Add a new line
‘user_registered’ => ‘user_registered’,
after email.
Now you can monitor your latest user registrations with a click of a button.
Cheers.
This article was inspired by:
Site | Article | Link |
---|---|---|
Open Script Solution | How to Add user_registered Column in Authors & Users Page on wp-admin of WordPress | http://www.openscriptsolution.com/2010/01/13/how-to-add-user_registered-column-in-authors-users-page-on-wp-admin-of-wordpress/ |
P.S.:
To save a couple more clicks, you can now modify an admin link to your users. When clicked, you will go directly to users page sorted by Register Date in a descending order.
Open \wp-admin\media.php and search for comment “adding submenus to profile.php“.
In the next line replace users.php with a longer URL:
$submenu[‘users.php’][5] = array(__(‘Users’), ‘list_users’, ‘users.php?orderby=user_registered&order=desc’);
Always document any change to WordPress core files. Undocumented change will be forgotten and lost on the next upgrade.
[2012-12-26 WE 13:17] This solution tested and works with WordPress 3.5.
Works great except the register date is shifted one column to the right under the header role, info for role has shifted one column to the right under id. The column under date is empty.
Works like a charm! Thanks!!
The date column should appear the way your local computer date and time format is configured.
I personally like format YYYY-MM-DD, so I use it everywhere.
Thank you for your comment.
Hi,
How can the User Profile show?
Registered Date: 21.04.2015 as
Thanks.
Thank you so much. Works for version 3.9.1.
http://www.andropedi.com
Hi,
It works perfectly ! Great help :) Thanks !
BRILLIANT! Great code and clear instructions. THANKS!
You are right. Now I realize – the plugins are the way to go.
However, I already upgraded twice. The trick is to document every change in a separate private article, and to retrofit your changes on DEV, TEST and PROD servers.
You are actually manipulating wp code. Not cool. You can’t update anymore. Here is an approach, how to do it with a plugin http://tareq.wedevs.com/2011/07/add-your-custom-columns-to-wordpress-admin-panel-tables/
How to adding IP Column to this table?
You BEST!!!!
This is Admin only feature.
Usually visitors wouldn’t be able to see this feature in action.
great
this is realy work and tested in my web site http://zafile.com