Title: Querying Multiple Authors in WP_Query
Last modified: August 31, 2016

---

# Querying Multiple Authors in WP_Query

 *  Resolved [jonwatson87](https://wordpress.org/support/users/jonwatson87/)
 * (@jonwatson87)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/querying-multiple-authors-in-wp_query/)
 * I have a list of authors stored in a variable and want to do a WP_Query based
   on those values, but can’t quite figure out how to do it.
 * So, say my variable echoes back with user-logins: joe.bloggs,jane.doe,steamy.
   bacon – how do I go about adding posts by those coauthors to my query args?
 * [https://wordpress.org/plugins/co-authors-plus/](https://wordpress.org/plugins/co-authors-plus/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [jonwatson87](https://wordpress.org/support/users/jonwatson87/)
 * (@jonwatson87)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/querying-multiple-authors-in-wp_query/#post-7448026)
 * Got it! 🙂
 * I edited my variable ($theauthors) to include the prefix (cap-) so that my variable
   echoed something like this:
 * cap-joe.bloggs,cap-jane.doe,cap-steamy-bacon
 * and then used the following tax_query:
 *     ```
       'tax_query' => array(
       	array(
       		'taxonomy' => 'author',
       		'field' => 'slug',
       		'terms' => explode(',', $theauthors)
       	)
       )
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Querying Multiple Authors in WP_Query’ is closed to new replies.

 * ![](https://ps.w.org/co-authors-plus/assets/icon-256x256.png?rev=2945095)
 * [Co-Authors Plus](https://wordpress.org/plugins/co-authors-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/co-authors-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/co-authors-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/co-authors-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/co-authors-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/co-authors-plus/reviews/)

## Tags

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

 * 1 reply
 * 1 participant
 * Last reply from: [jonwatson87](https://wordpress.org/support/users/jonwatson87/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/querying-multiple-authors-in-wp_query/#post-7448026)
 * Status: resolved