Add User Register Date Column in WordPress 3.X and 4.X

2017/03/04
By
Modified: 2017/02/22

Crafted Specifically for WordPress 3.X and 4.!

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.

Tags: , , , , , ,


13 Responses to Add User Register Date Column in WordPress 3.X and 4.X

  1. isak
    2017/04/29 at 00:44

    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.

  2. Yaniv
    2015/10/08 at 07:25

    Works like a charm! Thanks!!

  3. Udar Gromov
    2015/04/21 at 11:56

    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.

Add Your Comment Ваш Комментарий

Your email address will not be published. Required fields are marked *

* Ваше Имя *
* Ваш Email (не будет показан на сайте)*

*