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

This code:

<?php the_terms($post->ID, 'type') ?>


<a href="/archives/type/image" rel="tag">Tag</a>  

What do to if I want to display only "Tag" word, not link eg.



share|improve this question
up vote 8 down vote accepted

While you can specify separators and such in the_terms() arguments, it assumes that you actually want links.

You can discard unwanted HTML by using filter:

add_filter('the_terms', 'no_terms_links', 10, 2);

function no_terms_links($term_list, $taxonomy) {

    if ('type' == $taxonomy)
        return wp_filter_nohtml_kses($term_list);

    return $term_list;

Or just use deeper get_the_terms() function and iterate through its return to build your own markup.

share|improve this answer
I've added your code, but I'm still getting links :( – Wordpressor Dec 9 '10 at 16:00
Don't forget to change type to your actual taxonomy in snippet. – Rarst Dec 9 '10 at 17:29
At a super-duper simple scale, what about just echo strip_tags( get_the_term_list($post->ID, 'type') ) ? – TheDeadMedic Dec 9 '10 at 18:00
Yeaah, that would do it... I deem today - the day of overthinking code. :) – Rarst Dec 9 '10 at 18:14

At a super-duper simple scale, what about just:

echo strip_tags( get_the_term_list($post->ID, 'type') )
share|improve this answer
What about it? Does it work? What does it do? Is this an answer and how does it help? – kaiser Oct 17 '14 at 10:46

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.