WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been looking for a list all WP_Query arguments.

This looks obvious, but http://codex.wordpress.org/Function_Reference/WP_Query isn't helpful at all, "post_type" is mentioned only in an example, and arguments like "posts_per_page" aren't even there.

share|improve this question
The WP_Query page is purposely written in that way to detail the methods of the WP_Query class, query_posts lists all the possible args for use with queries, query_posts is just a wrapper/convenience function for the main $wp_query->query() object. $wp_query->query() is also just a wrapper for the $wp_query->get_posts() method. – t31os Mar 2 '11 at 17:22
up vote 4 down vote accepted

I believe this is what you're looking for.

(You're right to look for it on the class documentation...i think the reason why it's on query_posts() is because that (and get_posts()) is meant to be the primarily used function to get posts.)

share|improve this answer

Hi @Wordpressor:

The arguments for WP_Query() are documented on the query_posts() page on the Codex:

And for WordPress 3.1 you can also find the most complete documentation for the WP_Query args on lines 1872 through 2705 of /wp-includes/query.php. :-)


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.