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

We can filter our posts with a URL query string: http://mysite.com/?cat=5

We can also use a similar syntax for get_posts('cat=5') and new WP_Query('cat=5').** get_posts('param=value'); just passes the string to new WP_Query('param=value');, so it follows that these work the same.

While these all seem to have the same syntax, the URL query string supports different parameters.

  • I don't see subpost or subpost_id documented anywhere in the WP_Query class, yet it seems to do something with the URL (although I can't figure out exactly what)
  • category__in doesn't work with the URL query string.

After much searching, I finally found this site that lists the supported URL query string variables, but not sure what all of them do.

Where is the documentation for these URL query string variables?

WP_Query supports many more parameters that don't seem to be supported in the URL query. Why doesn't the URL query string just get passed directly to WP_Query?

share|improve this question
up vote 2 down vote accepted

Take look at official Query vars. You will see two columns and by then you will get why category__in doesn't work with the URL query string. (basically, the private keywords works only if you specify them in wp_query or so...)

About subpost, I am not a hundred percent sure, what it is. In the whole WP_Query it is mentioned only with attachments, take a look.

share|improve this answer
ty, never seen that page :/ – Mike Lewis Nov 13 '13 at 20:59

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.