Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

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

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

2 Answers

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
add comment

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
add comment

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.