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

how can i use multiple meta_key and meta_value in query_posts?

For example, I want to find multiple content with two different meta_key and meta_value. How do I do this?

i using this code but not effective:


please help me...

share|improve this question
up vote 3 down vote accepted

This is not currently possible with query arguments alone (realm of filtering raw SQL query and such).

If your task is not time-critical then I suggest to wait for upcoming WP 3.1 release. It will feature much more flexible querying capabilities for custom fields.

See Advanced Metadata Queries for post on upcoming improvements.

share|improve this answer
thanks .i wait for wp 3.1 – mehdi Dec 24 '10 at 20:35

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.