How to Display Recent WordPress Registered Users

x theme
(Last Updated On: July 10, 2014)

We have seen a thing in vBulletin forums or other forums, where we can display recently registered users. You can also do that in WordPress.

The WordPress tip, we’re mentioning below shows 5, 10 and unlimited latest registered users in WordPress, in case you’re allowing user’s registration into your WordPress powered website.

You’ll have to following code in the template file where you want to display recently registered users. The tip we’re sharing below displays 7 recently registered members. But you can change the number according to your need.

<?php $getUserNames = $wpdb->get_results("SELECT user_nicename, user_url FROM $wpdb->users ORDER BY ID DESC LIMIT 5");
foreach ($getUserNames as $username) {
echo '<span>' .get_avatar($username->comment_author_email, 45).'<a href="'.$username->user_url.'">'.$username->user_nicename."</a></span>";

About the author


Leave a Reply

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