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 need to find only posts with a tag forest gump. I've tried: new WP_Query('tag=forest+gump');, new WP_Query('tag=forest gump');. However they both return ALL the posts and not only the posts with forest gump tag. Single tags (without spaces) work fine, though. Alternatives (like plain SQL) will work as well.

The entry tag line is forest gump, forrest gump, questend.

share|improve this question
up vote 2 down vote accepted
new WP_Query(array('tag_slug__in' => array('forrest-gump', 'forest-gump', 'questend')));

new WP_Query('tag=forrest+gump,forest+gump,questend'); should work too...

share|improve this answer
The + doesn't work, but the dashes work just fine. Thank you. Nevertheless, I didn't find this anywhere in the WP docs. – Gajus Jun 29 '11 at 12:25
@Guy WP_Query > Tag Parameters – Rarst Jun 29 '11 at 12:50
@Rast, yes, I saw that page. Mind pointing out the paragraph that provides this information? – Gajus Jun 29 '11 at 17:20
This displays every article of those tags when I query it.. – Maartje Mar 18 '14 at 16:09

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.