Using tag_description() in WordPress To Create Unique Tag Pages

Something I’ve been testing on You’re Supposed To Be At Home is WordPress’  internal tag function. Tags are largely unused on blogs nowadays, and with good reason – tag pages create duplicate content. Often people just block them from search engines, but instead of blocking them, you can turn your tag pages into marvellous search engine friendly pages with rich content.

To do this, you need to make a few changes to your template. Open up tag.php and begin editing!

Switch Posts To Exerpts

Double check your site & see if there is a line that looks like the following:-

 <?php the_content(); ?>

Replace this with the following:-

 <?php the_excerpt(); ?>

Most templates do have the_excerpt() function, but double check it!

Add tag_description() above the Post Loop

Within the template, above the WordPress Loop, add the following:-

<?php 						if (tag_description() != "")


						echo tag_description();

						} ?>

This will add on a paragraph or two onto the top of the post if there is anything located in the tag_description(). You add things via the “Post Tags” in WordPress’ Admin section.

Do I Have To Add A Tag Description for Every Tag?

No, only your most popular pages. They make great “sneeze pages”. Landing pages that get people looking at a selection of your posts. In the Tag Description, link to a range of your best posts related to that tag.


Do you use tag descriptions? Say so in the comments!

6 thoughts on “Using tag_description() in WordPress To Create Unique Tag Pages

  1. Nice post, duplicate content issues made me remove these pages but I shall use this to recreate them. And have another go.

  2. I’m a little slow, here.

    And quite honestly, I’m not sure what to ask to get clarification. Can you give a screen shot or two to explain what you mean? Or link directly to a post on the other blog that does this?

    What I do understand is that this would be a good way to gather common content, and that I would like to do. I’m just confused as to your suggestion.

    Thanks, Rhys.

  3. I think I already do something VERY similar with my category pages, using else-if thingymajiggys and then I write some text about each category. This only works if you already know what your categories are Or don”t mind writing them each time manually in a good old fashioned file & uploading.

    This is how I did my silicone bakeware site – each section is category and the picture & text for each category comes from the if else thingywhatsit.

    I assume there’s a cat_desc tag so you can do the same for categories? Cus it would be easier to update in wordpress for my other sites…

Comments are closed.