How To Create Unique Content On Every WordPress Tag And Category Page.

Filing SystemIn my last post I described a solution to the duplicate content problem. This post follows up on the idea of solving the duplicate content problem by providing valuable unique content on your tag and category pages. This way, instead of excluding those pages from being listed in the search engines, you can add even more valuable content to your blog, on theme focused pagesTheme focusing your blog is a critical optimization strategy that is as simple as choosing a sound category and tag structure that groups your posts intelligently and sticking to it., for the search engines to index. This will also give readers more avenues to find your content based on a wider variety of semantically related search terms.

Warning Real Work Ahead. This May Not Be For You.

Right up front, let me say that if you aren't willing to invest some time and effort into your blog posts, if you are looking for push button solutions, if you are looking for the easy automated path to success, this post is going to greatly disappoint you. What I'm about to describe is not even a little bit automated. I can't even think of a reasonable way that it could be automated. It means putting in the effort to take a couple extra minutes with each post and create from a couple to several whole new descriptions and titles for each post you add to your blog. I honestly don't expect more than five or ten percent of people who seriously read and consider this method to even try it, let alone adopt it.

That's actually great news for those few who do take the time. The benefits are great, and there is no simple way for the rest to automate and duplicate it, so you will gain and keep a true advantage over the vast majority of other bloggers out there.

The Problem With WordPress Out Of The Box

It's not really a problem with WordPress, since the theme architecture of the software itself is what actually makes it possible for us to do this. The real problem is in the approach that most bloggers and theme designers take to tag and category pages. In the worst cases they just display these valuable semantic keyword pages with the index.php template and you end up with several posts displayed in full text views, completely duplicating several of the single post view pages on every tag and category view. This can be somewhat mitigated by using the <!--more--> tag which will suppress the remainder of the post on page views other than the single post page.

At best many themes will include tag.php and category.php templates that explicitly make use of the post excerpt instead of the full post. But this means that the excerpt is being displayed on a number of pages depending on how many categories and how many tags you have placed the post in. This definitely is not ideal from an SEOSEO - Search Engine Optimization - The Practice of optimizing web pages in ways that make them accessible and indexable by Search Engines. standpoint. It is also disastrous from a VEOVEO - Visitor (reader) Enhanced Optimization - The practice of optimizing web pages to increase reader usability and friendliness. point of view.

Why Unique Content Tag And Category Pages Are Better For Everyone.

Displaying Unique Titles And Descriptions on Tag And Category Pages is better for all involved. For the Search Engines, this will generate more pages they can use in their indexes and provide them with more clues to the semantic relationship of content on your blog. For the readers, more opportunities to find your single post pages with valuable content are presented across a wider semantically connected selection of possible search terms. And for you, the blogger, it means more traffic, more readers and more potential for conversion to actions. Ahh, the sweet smell of blog success. :)

The Unique Tag And Category Page Process

The process involved to make this work utilizes the Get Custom Field Values pluginRegular readers will know that this is among my favorite plugins. I use it extensively on my blogs to do many things.. For each post you write you will enter a custom title and a custom description for each tag and each category used. For each tag you will create a custom title with the field name "%tag name% t" and a custom description with the field name "%tag name% d" for each category you will do the same with the fields names "%cat name% t" and "%cat name% d".

So if the post were filed in the category "optimization" you would have the fields "optimization t" and "optimization d". Then you would do the same for each tag name. Here is a screen shot of the custom fields from my last post that illustrates this step. Each of these custom fields is either a tag title or a tag description.
Custom Fields

Note: If you put each post in only one category, you can skip the custom description for the category and let it default to the post excerpt, since this will not be displayed anywhere else in the blog, it will be uniques to the category page view. I highly recommend resisting the temptation to use multiple categories and lots of tags. Your blog will be much more semantically themed if you limit each post to one category and three to five tags.

The Code That Makes It Work

In your tag.php template, you need to locate the section of the code that displays the title and post or the title and excerpt and replace it with this code.

[php]
< ?php $tagv = single_tag_title( '', false ); //tag name
if (c2c_get_custom($tagv. ' d')) : //tag extra field value
$tagt = c2c_get_custom($tagv . ' t'); //tag title
$tagd = c2c_get_custom($tagv . ' d'); //tag description
elseif (c2c_get_custom('tag d')) :
$tagt = c2c_get_custom('tag t'); //default tag title
$tagd = c2c_get_custom('tag d'); //default tag description
else :
echo 'no tag value passed';
$tagt = NULL; //Or just use the title
$tagd = NULL; //Or just use the excerpt
endif;
?>


< ?php if($tagt) :
echo $tagt;
else :
the_title();
endif;
?>

< ?php if($tagd) :
echo $tagd;
else :
the_excerpt();
endif;
?>
[/php]

for the category.php template you'll want to use this code.
[php]
< ?php $catv = single_cat_title( '', false ); //tag name
if (c2c_get_custom($catv. ' d')) : //tag extra field value
$catt = c2c_get_custom($catv . ' t'); //tag title
$catd = c2c_get_custom($catv . ' d'); //tag description
elseif (c2c_get_custom('tag d')) :
$catt = c2c_get_custom('cat t'); //default tag title
$catd = c2c_get_custom('cat d'); //default tag description
else :
echo 'no tag value passed';
$catt = NULL; //Or just use the title
$catd = NULL; //Or just use the excerpt
endif;
?>


< ?php if($catt) :
echo $catt;
else :
the_title();
endif;
?>

< ?php if($catd) :
echo $catd;
else :
the_excerpt();
endif;
?>
[/php]

In both cases the code will check to see if there is a custom field for the current tag or category with a " t" for the title and a " d" for the description. If there is it will use that value. If not it checks to see if there is a generic "tag t" and "tag d" for the tag page and "cat t" and "cat d" for category pages and displays that. If neither exist is will display the regular post title and the post excerpt. So if you forget to include a title or description it will degrade gracefully and not break your blog.

You can test this out with this post. Just click on one of the tags and check out the listing for this post. Then come back and click on another tag and you will see a different title and description. Same if you click through to the category view. On the front page I'm using the_content(), but the use of the <!--more--> tag means that only the first paragraph of the post is actually displayed. On my category page I'm actually displaying the excerpt instead of an additional category description, and I also use the excerpt as a meta description tag.

Usually I explain the code line by line, but this post is already pretty long, so I've foregone that. If you need me to add in a line by line explanation, leave a comment and I'll add it in for you.

I also want to mention that I do custom theme designs for reasonable rates that include lots of little extra goodies like this if you want them. hit me up on my contact form if you are interested in having a custom theme done.

Trackback URL for this post:

http://danemorgan.com/trackback/63
None
Login or register to tag items
 
Posted In
Tagged With
Like this?
Bookmark & Share:
StumbleUpon Submit to Mixx Save to Google Bookmarks Save to del.icio.us
Click, Copy and Link:
<a href="http://danemorgan.com/blog/wordpress/how-create-unique-content-every-wordpress-tag-and-category-page">How To Create Unique Content On Every WordPress Tag And Category Page.</a>

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

WordPress Uniquefier Plugin

This plugin is great as it will eliminate all the dupe content pages created by WordPress.
Btw, you may want to check http://Uniquefier.com to eliminate the dupe content from the articles too.

goscript (not verified) | Sun, 08/31/2008 - 11:54

How about some demos?

I'd like to see a handful of blogs running this stuff. Can you email me some links? gyrocy -[at]- gmail -[.]- com

Dane Morgan | Sun, 08/31/2008 - 21:03

Hi, You can see the DP sale

Hi,
You can see the DP sale thread and the reviews here:
http://forums.digitalpoint.com/showthread.php?t=1000918

goscript (not verified) | Mon, 09/01/2008 - 10:55

@Michael I haven't upgraded

@Michael

I haven't upgraded to 2.6 yet. I may actually be converting to Drupal. But nothing I can think of in the code should preclude it from working with 2.6 unless they changed the way they handle the extra fields, and as far as I know they did not.

Dane (not verified) | Sun, 08/03/2008 - 08:55

This looks like a great

This looks like a great solution, though it may take quite a bit of time to get the work done on it.

Will all of the code examples still work with the latest 2.6 WP release?

Awesome work, Dane!

Michael
http://www.halfhourworkweek.com
"Do what you love and live your dreams"

Michael (not verified) | Fri, 08/01/2008 - 03:44

This seems like sooooo much

This seems like sooooo much work when there is a much, much easier way to do this. All you have to is create a tag template for tag pages and a category template for category pages. You just do this once for each tag and category, not every time you write a post.

This way, as well - you can change the layout of any page if you wish, or add specific ads per tags/categories, it's easier and much more flexible than the code type hack above.

JTPratt's Blogging Mistakes (not verified) | Mon, 07/14/2008 - 07:48

[...] Fresh | Internet

[...] Fresh | Internet Marketing Badger Giving Back to the WordPress Community

Wp Spinner WordPress Plugin. | 7Wins.eu (not verified) | Mon, 06/09/2008 - 06:52

I was just going to download

I was just going to download this, but realised my theme is changed. I would have to put this in single.php in my themes folder, but what wordpress code would I need to show the tags and category info at the bottom?

Thanks

Learn to Draw (not verified) | Sat, 06/07/2008 - 00:43

Thank you for good info,

Thank you for good info, I'll give a try.
BTW, that Amber Alert Ticker in the right upper corner disturbs scrolling of your page in latest Firefox on Ubuntu. Possible on Windows too. Thanks for that also: I added it to AdBlock Plus blacklist :)

maxoud (not verified) | Wed, 05/07/2008 - 10:07

Oh, thanks so much! Before

Oh, thanks so much! Before reading it, I always think creating unique content is hard. After reading it, I found it's a easy job.

craft supplies (not verified) | Wed, 05/07/2008 - 08:12

I don't know that's a lot to

I don't know that's a lot to do for a post. Especially if you're not THAT into making it work. Like me. xD

Jenny (not verified) | Tue, 03/25/2008 - 11:07

really does sound like a lot

really does sound like a lot of work.

I didn't understand the t and d differences.

Living Off Dividends (not verified) | Wed, 02/13/2008 - 07:52

While interesting for sure,

While interesting for sure, it seems like too much work for me, at least not worth the results you are getting. There are more rewarding ways to spend your precious time IMHO...

Mapquest (not verified) | Thu, 01/03/2008 - 14:32

[...] Dane Morgan has

[...] Dane Morgan has written a beautiful article entitled How To Create Unique Content On Every WordPress Tag And Category Page, it’s a definite must read for those who are concerned about SEO, in fact even if your not to [...]

Hey Stephen, Good point out

Hey Stephen,

Good point out there. Actually this all works with the more tag! ;) I use the more tag as well, and thats what drives the front page on my blog.

Dane (not verified) | Fri, 12/14/2007 - 13:19

Dane, that's a really neat

Dane,

that's a really neat solution. Personally I won't adopt it (too much work for me! and I use the more tag), but I really admire it. Well done. I'll keep it in mind when I hear people who want a real solution to this..

Stephen Cronin (not verified) | Fri, 12/14/2007 - 03:33

[...] Dane Morgan has

[...] Dane Morgan has written a beautiful article entitled How To Create Unique Content On Every WordPress Tag And Category Page, it’s a definite must read for those who are concerned about SEO, in fact even if your not to [...]

Tip: Creating Unique Content On Every WordPress Tag And Cate (not verified) | Tue, 12/11/2007 - 12:41

Hi Dewald, Thanks for

Hi Dewald, Thanks for stopping by.

Yeah, my approach definitely isn't intended for folks looking for the push button solution. I am more interested in the higher quality approaches on this blog. I do deploy a lot of automation in many of my niche blogs, but this is where I blog about high touch, high feel blogs that you actually craft as opposed to push.

I did notice some buzz about your plugin, and it's on my list to play with at some point. I'm also talking to a coder about a solution that can let you create some specific rules regarding targeted words and phrases and then run a spin from a limited user defined thesaurus to "auto generate" tag and category description text. Not sure it's really even feasible, but I'm exploring it.

Dane (not verified) | Mon, 12/10/2007 - 22:28

[...] possible use local tag

[...] possible use local tag pages and consider setting up unique tag based titles and descriptions for each post for each tag you assign to the [...]

Tagging Your Blog Posts With The Right Tags Means More, High (not verified) | Mon, 12/10/2007 - 22:14

Dane, It's an interesting

Dane,

It's an interesting approach you've taken to fighting duplicate content. I'm still looking for the solution that doesn't require work. Even my WordPress plugin, WP Spinner, which takes a different approach, also requires work in the sense that one has to define alternate content versions when you write the content. The plugin then uses the alternate versions to make each page view of the content unique, meaning Google never finds exactly the same text when it visits a particular post or page. My rationale was, if the text of a post differs when it's displayed in the single post view and the category archive view, for example, then there can't be a duplicate content issue between the two views. Another day, another approach. :)

Dewald - Fighting WordPress Duplicate Content (not verified) | Mon, 12/10/2007 - 22:06

[...] “Right up front, let

[...] “Right up front, let me say that if you aren’t willing to invest some time and effort into your blog posts, if you are looking for push button solutions, if you are looking for the easy automated path to success, this post is going to greatly disappoint you. […] It means putting in the effort to take a couple extra minutes with each post and create from a couple to several whole new descriptions and titles for each post you add to your blog. I honestly don’t expect more than five or ten percent of people who seriously read and consider this method to even try it, let alone adopt it. “How To Create Unique Content On Every WordPress Tag And Category Page“ [...]

[...] Dane Morgan has

[...] Dane Morgan has written a beautiful article entitled How To Create Unique Content On Every WordPress Tag And Category Page, it’s a definite must read for those who are concerned about SEO, in fact even if your not to [...]

Tip: Creating Unique Content On Every WordPress Tag And Cate (not verified) | Wed, 12/05/2007 - 14:44

[...] I need to grab a

[...] I need to grab a couple screen shots and format some code for you first though. Here’s the How To Use Custom Unique Titles And Descriptions [...]

The Duplicate Content Problem: Bad Solutions And A New Idea. (not verified) | Sun, 12/02/2007 - 20:59

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Restrict text by wrapping in [restrict:roles=<comma separated roles>] and [/restrict]
  • Links to specified hosts will have a rel="nofollow" added to them.

  • Highlight terms in this textarea.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • Use <fn>...</fn> to insert automatically numbered footnotes.
  • You may link to webpages through the weblinks registry

More information about formatting options

CAPTCHA
Please fill out this captcha to demonstrate your humanity.
4 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.