Take the 2-minute tour ×

I need to assign some tags to my posts (for external use), but I don't want them showing anywhere that tags are listed. Can someone please give me an example as to how to do this?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Use get_tags() instead of the_tags() in your templates

 $tags = get_tags();

 foreach ($tags as $tag)
   if($tag->name=='the tag i want gone') continue;// do this for every tag you want gone
   echo $tag->name.', ';  
share|improve this answer
I'm getting the following error for line "echo $tag;". Catchable fatal error: Object of class stdClass could not be converted to string". Any ideas? –  Zoolander Jun 3 '11 at 19:04
sorry..i edited it..i guess it will work now –  rootatwc Jun 3 '11 at 19:25

this question is very old but i came across this need and i found an interesting solution that i wanted to share.

It is better to apply a filter to the tags and you won't be afraid of missing points in your template where you show tags.

function exclude_tags($tags) {
 foreach ($tags as $tag)
  switch ($tag->name) {
   case 'exclude-this-tag':
   case 'exclude-this-tag-too':
    $newtags[] = $tag;
 return $newtags;
add_filter( 'get_the_tags', 'exclude_tags');
share|improve this answer

Your Answer


