Title: Quickest : wp_query or get_posts ?
Last modified: August 19, 2016

---

# Quickest : wp_query or get_posts ?

 *  [dunkkan](https://wordpress.org/support/users/dunkkan/)
 * (@dunkkan)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/quickest-wp_query-or-get_posts/)
 * Hi, I had a technical question, hope someone knows it :
 * Between wp_query and get_posts, wich call to the database is quicker ?

Viewing 1 replies (of 1 total)

 *  Thread Starter [dunkkan](https://wordpress.org/support/users/dunkkan/)
 * (@dunkkan)
 * [17 years ago](https://wordpress.org/support/topic/quickest-wp_query-or-get_posts/#post-963399)
 * I’m retaking this tread `:)`
 * I’m playing locally with a WP install, and in my theme I’ve had the occasion 
   to compare the two.
 * For me, `get_posts` is having a faster loading.
 * Is it my template ?
    Here’s a diagram of my `index.php` :
 *     ```
       get_posts(featured1)-------get_posts(featured2)-------get_posts(featured3)
       ----------a list : get_posts(again, simply the 10 last posts) --------
       ```
   
 * There, I realised I could not control, from the Admin Panel, how many posts I
   was calling in the Index, without editing the template. They were always 10, 
   and some future user wouldn’t like it, nor going to templating, so I went this
   way :
 *     ```
       WP_query(featured1)-------WP_query(featured2)-------WP_query(featured3)
       ------------------------------a normal loop---------------------------
       ```
   
 * Maybe it’s the quantity of WP_query I’m calling, but it’s a bit slower, and the
   images takes a bit more time than with `get_posts`.
 * If anyone have some idea why / how to improve it / confirm it / comment it … 
   I’d like to optimize the template.
 * Thanks for any input,

Viewing 1 replies (of 1 total)

The topic ‘Quickest : wp_query or get_posts ?’ is closed to new replies.

## Tags

 * [get_posts](https://wordpress.org/support/topic-tag/get_posts/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * 1 reply
 * 1 participant
 * Last reply from: [dunkkan](https://wordpress.org/support/users/dunkkan/)
 * Last activity: [17 years ago](https://wordpress.org/support/topic/quickest-wp_query-or-get_posts/#post-963399)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
