WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 do I remove the link generated by the_tags?

This is what I use today: <?php the_tags( '', '', '' ); ?>

That results in the tags assigned to the post. But I want to remove the link. Any idea?

share|improve this question

migrated from stackoverflow.com Feb 7 '12 at 15:04

This question came from our site for professional and enthusiast programmers.

up vote 2 down vote accepted

Use following code:

$posttags = get_the_tags();
if ($posttags) {
  foreach($posttags as $tag) {
    echo $tag->name . ' '; 

More details: http://wpeden.com/tipsntuts/getting-list-of-tags-for-a-post/

share|improve this answer

Get the tag list, and then strip the tags.

if (is_single()) { the_post(); rewind_posts();
  $articletags = strip_tags(get_the_tag_list('',', ',''));
  echo $articletags;
share|improve this answer

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.