Title: Get posts by user
Last modified: August 19, 2016

---

# Get posts by user

 *  [greenboy](https://wordpress.org/support/users/greenboy/)
 * (@greenboy)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/get-posts-by-user/)
 * How can i list all the posts made by an user?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [kz](https://wordpress.org/support/users/kz/)
 * (@kz)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/get-posts-by-user/#post-1366566)
 *     ```
       query_posts('showposts=-1&author=123'); // for example, 123 as user ID.
       if(hace_posts()) :
         while(have_posts()) :
           the_post();
           /* do stuff */
         endwhile;
       endif;
       wp_reset_query();
       ```
   
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/get-posts-by-user/#post-1366606)
 * You can also use `author_name=xxx` if you prefer to use a name in place of ID.
 * **Also note:** `showposts` is deprecated, and should be replaced with `posts_per_page`
   where appropriate.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get posts by user’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/get-posts-by-user/#post-1366606)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
