WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is is possible to paginate the get_users function with the "offset" parameter?

I have complete my custom query of users for my list and now I need to paginate the results into multiple pages.

Here is my sample code:


    $args = array(
        'meta_key' => 'jabber',
        'meta_value' => 'User Name',
        'meta_compare' => 'LIKE',
        'order' => 'ASC',
        'count_total' => true,
        'fields' => 'all',

    $blogusers = get_users($args_1);
    foreach ($blogusers as $user) {

        $user_id = $user->ID; 
        $user = get_userdata($user_id);

          echo '<li class="provider-list prov-list-gradient">' . $user->display_name . '</li>';



If there's anyone you can give some advice I would appreciate it.

Thanks in advanced.

share|improve this question
Show your code. – kaiser Oct 28 '11 at 0:37
@kaiser, Hi I included the code. Thank you. – user1893 Oct 28 '11 at 13:25
up vote 2 down vote accepted
$args = array("role" => "subscriber", "number" => 10);

get_users($args); //First 10 Users with the Role Subscriber

$args['offset'] = 10;

get_users($args); //10th to 20th Users with the Role Subscriber

and so on.

Offset = page * number

share|improve this answer
Thank you ljaas. Now I have a base to work with. I appreciate it. – user1893 Oct 28 '11 at 16:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.