wordpress snippets last updated   : August 18, 2014
we now have 638 snippets

Display all subscribers in an unordered list

wordpress snippet

Adding this snippet to your wordpress theme will display all subscribers in an unordered list

snippet :  PHPcopy
<ul>
<?php
    $blogusers = get_users('blog_id=1&orderby=nicename&role=subscriber');
    foreach ($blogusers as $user) {
        echo '<li>' . $user->display_name . '</li>';
    }
?>
</ul>

Did you like this post? If so please share it with your friends. Thanks!

  • jeffikus

    That’s not a very scalable solution unfortunately. You need to add pagination into it as well as the ‘number’ and ‘offset’ parameters to handle it. From my testing, the get_users() function does not handle well when you have more than approx 1000 results in the query.

    • http://wpsnipp.com Kevin Chard

      I have not tested this snippet with over 1000 subscribers myself so I have to trust you on this one. Without pagination this would be a solution for smaller websites, if you have another solution please feel free to contribute I would be happy to post the solution.

jqsnipp.com | we just launched jquery snippets website