Take the 2-minute tour ×

I need to programmatically create a list of the tags used in a Drupal 7 website. I'm browsing through the api/functions, but can't find something like "get_list_of_terms()" :-)

How should I proceed? Thanks! J.

share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

Exactly. A slightly more complete example is (you can substitute with your own vocabulary vid):

if ($terms = taxonomy_get_tree($vocabulary->vid)) {
  foreach ($terms as $term) {
      // Do something with $term->tid or $term->name
share|improve this answer
Thanks, that's of great help :) –  Jem Apr 19 '12 at 7:32
add comment

To get a list of taxonomy terms for a particular vocabulary, you could use taxonomy_get_tree

share|improve this answer
Thanks, great direction! –  Jem Apr 19 '12 at 8:37
add comment

Your Answer


