• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Nile Flores Media

Helping You Rock Out Your Website Like A Rockstar

  • Home
  • About
  • Blog
  • Portfolio
  • Hire Me
  • Resources
  • Contact
  • Blogging
  • WordPress
  • Social Media
  • SEO
  • Web Design
  • News
  • Podcast
You are here: Home ยป WordPress ยป How To List The Most Recent Registered Users In WordPress

How To List The Most Recent Registered Users In WordPress

By Nile Flores Leave a Comment


wordpress-tricks-200x200For people who run websites that allow people to register, especially a community type website, sometimes it might be a novel idea to list the most recent registered users in WordPress.

To do this, you must work a little PHP and WordPress database magic. For this code snippet tutorial, we’re bring in the user’s name, user’s profile link, and the user’s gravatar. The following code can be used in your theme template, or you can use a plugin like PHP Code Widget, that allows you to add PHP to your widgets.

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

I’ve left this in an unordered list with it’s own CSS class so you can happily customize the CSS as you want. ๐Ÿ™‚ Also, you can alter the code to list more than 5.

As a note, if you don’t wish to mess around with code, you can also use the Recently Registered Widget plugin. This plugin gives you more options to display. It’s a little rough on the default design, but you could probably tweak it to suit your needs using some CSS magic. ๐Ÿ˜‰

Pretty nifty, huh?


Filed Under: WordPress Tagged With: most recent registered users wp, registered users, wordpress registered users, wordpress tricks

About Nile Flores

Nile is a 43-year old female from the greater St. Louis (Southern Illinois side) area. Nile is a mother of 1 son. She is also a web designer and developer, a graphic designer, and a public speaker, who exclusively designs and develops using WordPress. She also blogs at GoDaddy's Blog, Verpex Hosting's blog and her very personal sites, Pixelled and Nail Polish Happy.




Related posts:

No related posts.

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

Follow Me On:

  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Get The Latest WordPress & Blogging Tips

Sign up for my newsletter, and also get my free ebook on 10 Reasons Why Your Website Isn't Converting, and How to Fix it!




Try to be More Positive on Social Media

Note: You can click on image and view the video in a larger lightbox window.

Footer

The Blog

Lots of free information, tutorials, and more to help you bring your best foot forward with your website.

  • Blogging
  • WordPress
  • Social Media
  • SEO
  • Web Design

Get The Latest WordPress & Blogging Tips

Sign up for my newsletter, and also get my free ebook on 10 Reasons Why Your Website Isn't Converting, and How to Fix it!

Copyright © 2025 · · WordPress