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

2017/10/04
By
Modified: 2017/09/16

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. Umut
    2015/04/21 at 08:38

    Hi,
    How can the User Profile show?

    Registered Date: 21.04.2015 as

    Thanks.

  2. mrrssy
    2014/06/19 at 18:41

    Thank you so much. Works for version 3.9.1.
    http://www.andropedi.com

  3. Hina
    2013/12/11 at 06:22

    Hi,
    It works perfectly ! Great help :) Thanks !

  4. The Bone Reader
    2011/12/04 at 07:47

    BRILLIANT! Great code and clear instructions. THANKS!

  5. Udar Gromov
    2011/12/01 at 21:22

    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.

  6. OneWorld
    2011/12/01 at 19:44

    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/

  7. Lin
    2011/08/14 at 13:46

    How to adding IP Column to this table?

  8. Lin
    2011/08/12 at 06:02

    You BEST!!!!

  9. Alex the Great
    2011/05/03 at 09:42

    This is Admin only feature.
    Usually visitors wouldn’t be able to see this feature in action.

  10. zalila
    2011/05/03 at 01:16

    great

    this is realy work and tested in my web site http://zafile.com

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

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

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

*