What are all the available parameters for query_posts?

Below is everything from WordPress 3.0.1 found in the parse_query() function of /wp-includes/query.php (lines 1246-1550).
However, it’s possible for a plugin to add parameters and so a list can never be fully complete:

  • attachment
  • attachment_id
  • author
  • author_name
  • cat
  • category__and
  • category__in
  • category__not_in
  • category_name
  • comments_popup
  • day
  • error
  • feed
  • hour
  • m
  • minute
  • monthnum
  • name
  • order
  • orderby
  • p
  • page_id
  • page
  • paged
  • pagename
  • post__in
  • post__not_in
  • post_status
  • post_type
  • preview
  • robots
  • s
  • sentence
  • second
  • static
  • subpost
  • subpost_id
  • tag__and
  • tag__in
  • tag__not_in
  • tag_id
  • tag_slug__and
  • tag_slug__in
  • tag
  • taxonomy – (pre 3.1)
  • tb
  • term – (pre 3.1)
  • w
  • withcomments
  • withoutcomments
  • year

    Pre WP 3.1

  • meta_key
  • meta_value

    Since WP 3.1

  • fields
  • meta_query
  • tax_query

Leave a Comment