Title: Question About get_posts Parameters
Last modified: August 19, 2016

---

# Question About get_posts Parameters

 *  [jtrost](https://wordpress.org/support/users/jtrost/)
 * (@jtrost)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/question-about-get_posts-parameters/)
 * Let’s say I have a WordPress site with 10 posts and I want to find what posts
   are tagged “news”. However, I only want to look for the tag in posts 1, 2, 3,
   4, 5, and 6. I don’t care about posts 7, 8, 9, and 10. Will these arguments return
   ONLY posts tagged “news” in the collection of posts I specified?
 * $args = array(
    “tag” => “news”, “include” => “1,2,3,4,5,6” );
 * As a follow up, what if I have a collection of 50 posts and 10 tags? Are there
   any performance issues I need to be aware of when using $args with very specific
   parameters?

Viewing 1 replies (of 1 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/question-about-get_posts-parameters/#post-1752941)
 *     ```
       $args = array(
         'tag' => 'news',
         'post__in' => array(1,2,3,4,5,6),
         'post_type' => 'post',
         'post_status' => 'publish',
         'posts_per_page' => -1,
         'caller_get_posts'=> 1
       );
       ```
   
 * Don’t know the answer to your follow-up
 * Related:
    [http://codex.wordpress.org/Template_Tags/query_posts](http://codex.wordpress.org/Template_Tags/query_posts)

Viewing 1 replies (of 1 total)

The topic ‘Question About get_posts Parameters’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/question-about-get_posts-parameters/#post-1752941)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
