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'm displaying all posts by category in my template and i was wondering: is it possible to get a list of all tags used by that category?

i only found out how to make a tag-dropdown but it's from all articles, i couldn't find out yet how to filter it by category - any ideas?

here's the link http://wphacks.com/how-to-display-wordpress-tags-dropdown-menu/

thx in advance

share|improve this question
up vote 4 down vote accepted

This shows you how to get tags for a category:


share|improve this answer
That code example is not compatible with wordpress blogs that have a different table prefix than wp_ :/ – hakre Mar 21 '11 at 13:43
To fix that, you can manually replace all instances of wp_ in the sql with $wpdb->prefix. – imHavoc Mar 21 '11 at 19:54

Late answer

There's get_terms() here for that. No need for any custom queries.

share|improve this answer
Just adding, yes. This is the way to use this. – buschschwick Oct 30 '15 at 18:40

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.