Can I achieve this with wp_query? I only want to get pages that have parent selected.

I'm using JSON API plugin and need to make a http request - would this be possible with url wp query also? For example, I'm doing requests like this: http://example.com/api/get_posts/?post_type=page&posts_per_page=1&orderby=rand and they work perfectly fine.

Perhaps using something like post_parent__not_in => array() (but in a url-like fashion?)

A better question could be: How to use WP Query arguments that accept arrays within url?

Thanks for any help

1 Answer 1


To get only child pages (pages that have parent selected), you can use this query:


And that should also give you the answer for your second question, I guess ;)

If you want to pass array(1=>'foo', 2=>'bar') as param called my_array, you should use this query:

  • The &post_parent__not_in[]= did it. Never used this syntax and queries inside url so was quite confusing I must say. Thank you :)
    – trainoasis
    May 21, 2015 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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