How to display next and prev pagination links with WP_User_Query?

I’m not aware of any generic helper – all the post-related navigation functions seem to be tied into the global WP_Query instance. The only real useful function at your disposal is get_pagenum_link:

$paged = max( 1, get_query_var( 'paged' ) );

if ( $number * $paged < $wp_user_query->total_users ) {
    printf( '<a href="https://wordpress.stackexchange.com/questions/267947/%s">Next</a>', get_pagenum_link( $paged + 1 ) ); 
}

if ( $paged > 1 ) {
    printf( '<a href="https://wordpress.stackexchange.com/questions/267947/%s">Back</a>', get_pagenum_link( $paged - 1 ) ); 
}

Note the function returns escaped strings by default, so no need for esc_url.

Leave a Comment