By creating custom WordPress category template (or tag template) pages in your theme, you can boost SEO significantly, better monetize your pages, and ensure good search placement and indexing for all category pages. Without them, you are probably hurting your web site and losing money – and maybe even having duplicate content issues. I’m going to show you why these pages are so important and how to create your own descriptive content rich category index template pages in WordPress!
**UPDATE April 2008**
If you look at the very first comment at the bottom of this tutorial you’ll see that Charles asks a great question – “How do I make a WordPress tag template page?” It’s so similar to a category template page (and has the same search engine indexing benefits) that I’ve updated this page to include how to create tag template pages for your WordPress blog as well. This greatly increases the amount of pages you can have indexed in the search engines! Tags have only been around since WordPress 2.3, but their use is spreading quickly – and you should make use of them as well!
This post is now installment #3 of the Managing WordPress More Effectively Series, showing you unique ways to get the most out of your content and your WordPress blog or web site.
Looking at the millions and millions of WordPress blogs out there, it’s not hard to see that most people don’t customize their theme at all. Granted WordPress is pretty good at SEO out of the box in a default install, and you can use a plugins to help with SEO too – such as All in one SEO pack, or (the one I use) wpSEO. You would be surprised (if you aren’t already) how easy it is to hack and customize your WordPress theme to not only make your web site more your own – but make it EVEN MORE search engine and crawler friendly. This leads to better google (Yahoo! and MSN) placement, more traffic, more visitors – and hopefully more money for you!!
Let’s talk for a second about the default WordPress category pages and WordPress tag pages. First of all, when you publish WP posts you should have some “bins” to place them in – as if you were filing paperwork, putting away books, or your CD collection. CD collection is a good analogy because you have genre’s like rock, and country, classical, blues, rap, etc. These would be your ‘categories’. But “Van Halen”, or “Eddie Van Halen” would be a “tag“. Some people use their categories “as tags” and end up with dozens and dozens of them. I’m a victim of this myself, and to take advantage of what I’m about to teach you – you shouldn’t have a zillion categories set up. If you do that’s not such a bad thing as much as it will take a very long time to create template pages for each and every category you have. In addition, you have the ability to create custom tag pages as well, and if you have created a lot of tags over time for all your WordPress posts you could have a lot of potential custom tag pages to create.
Every category you create in WordPress creates it’s own “category” page – which lists posts that were filed in that category. By default each WP category page has the same header, sidebar(s), and footer, and the content of the page are the first so many words or sentences of the posts filed there. So while the category page is a great way to categorize content – there isn’t anything significant to this page to a search engine or crawler. It’s just a bunch of snippets (or full posts depending on how you have your options setup) matching other full pages on content on your site. On this site I have 23 categories (and that’s probably too many). As of this writing, I have 6 posts in the “wordpress seo” category. The only shot I have at someone knowing that my site has articles on wordpress seo is if one of those 6 pages somehow come up in a search. Be default all category pages are simply www.yoursite.com/category/category-name-here. Looking at www.jtpratt.com/category/wordpress-seo I see that only one article even uses the words “wordpress seo” in it’s title. If I were selling “wordpress seo” as a product – I’d be doing a pretty poor job, wouldn’t I?
Tag pages pretty much work the same way. I haven’t used tags much on this site (yet), but when you add tags to your posts a page is created for each tag as www.yoursite.com/tag/tag-name. All the tags you added give you the ability to create many customized pages for the search engine crawlers to eat up. The ability to “tag” your posts in WordPress has only been around since version 2.3+. Before WordPress 2.3 you could only tag posts if you had installed a plugin to do it. The thing that was weird about about tags with WordPress version 2.3 was that even though you had the ability to tag posts – there was absolutely no way to manage them at all. You couldn’t rename them, delete them, or anything – WP 2.3 provided now way to manage tags at all. This WordPress support page on tags reveals that WordPress coders provided no way to manage tags because they didn’t know what people wanted. If you’ve not yet upgraded to WordPress 2.5 – you’ll need to download and install the Advanced Tag Entry Plugin to manage your tags. Be advised, this plugin won’t work with WP 2.5 or anything before 2.3. It’s only good for the 2.3x series of WordPress installs. If you have WP 2.3 and have yet to upgrade to 2.5 this plugin will allow you to manage your tags so you can create tag template pages.
As much as I like the whole “blogging” paradigm – those of us that have been creating web sites for many years (12 years for me) remember when you build a static web site you would have an “index” page and “sub-index pages” for specific sections of the site. Those sub-index pages usually had a great description of what that part of the site was about and they usually got indexed as well (sometimes better) than your own homepage. In WordPress by default – a “category page” with only post snippets doesn’t have a fighting chance at a good search result listing for your blog.
You can find out how badly you’re hurting yourself right now by doing a google search. Just type in only the name of your domain for the search like this: www.jtpratt.com. Here’s an example of mine…
Do you notice something here? My homepage shows up, and then one post page – and that’s it! If fact if you do a “site:www.jtpratt.com” search you’ll find that I only have 33 pages indexed at all – and they’re all post pages! First off – category pages could cause you issues with google and “duplicate content” normally because there isn’t anything significant on them (content wise). The two plugins that I mentioned earlier for SEO have options to “eliminate duplicate content” (wpSEO has a checkbox), and when that’s enabled it placed this meta tag on your category pages:
This tells the search crawler to NOT index your category page, but move on to other pages in your site. Now I know WHY my category pages weren’t indexed, but if the WERE (in their current state) it would have hurt me anyway. Google would have listed them, but under that little message it loves to give – something that looks a little bit like this:
Now that I’ve explained all this – down to brass tacks: How to Create Your Own Content Rich Category and Tag Index Pages and Templates in WordPress!
You would be surprised how much information is documented about WordPress – the details on how to create your own category template and tag template pages are fully available on the Category Template documentation page and Tag Templage documentation page in online WordPress Codex. It’s very simple.
When wordpress builds a category page, it has to “figure-out” which template theme file to use. The order it looks for them is like this:
When wordpress builds a tag page, it has to “figure-out” which tag theme file to use. The order it looks for them is like this:
These files are part of your WordPress “theme” and more than likely you already have 2, 3, and 4. Some (very few) themes may have only 3 and 4. But I’ve never – EVER seen a theme (and I’ve used and installed hundreds) a theme that contained #1. What is this #1 file and what makes it so special? By default WordPress uses one theme file (category.php or tag.php or archive.php) for all category and tag pages. That means, even if you added some description text to category.php or tag.php – it would display on ALL your category or tag pages. You want to be able to add custom content to every category page you have – like “sub-index” pages in your site. The first thing you need to know is the WordPress ID# of YOUR categories and the names of your tag “slugs”. In your WP Dashboard go to Manage -> Categories. You should see something like this:
Every category you have has an ID#. Print that page out or write them down. You can’t do this next part within your WordPress install, to create these category pages you must have access to your web site in FTP, and download your current category.php from your theme directory. Then all you need to do is save it for each category that you have. The first one I have listed is category #18, so I would open category.php on my local PC and “save as” category-18.php”. You want to “save as” for each and every category number that you have. Then upload them to your web site in your theme directory.
For your tags you need to know the names of your slugs. WordPress 2.5 has the ability for you to manage your tags, if you’re using WordPress 2.3 you’ll need to follow my earlier directions to install a plugin to do that so you can get your tag (slug) names. If you have a tag page (tag.php) in your theme directory, download it now. If you don’t have one then download your archive.php file. Rename it to “tag-slug.php”, meaning that if the name of your tag was “wordpress-hacks” then you would name your file “tag-wordpress-hacks.php”. Now upload it back to your theme directory.
Next, open your WP Dashboard again and go to Presentation -> Theme Editor. Under your theme file pages listed on the right will (now) be the category page and tag page you just created. Click on one to open it up for editing. Remember that the WordPress category and tag pages also use “the loop”, which basically means it’s going to cycle through a sequence of code over and over again for every post listed in that category. You want to add content to these category template pages, but you want to add it before or after the post – you don’t want to repeat it again and again for every post.
Find the following two lines in the top of your template:
Posts filed under ''
Just add a div with your content right after that like this:
This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content. This is my sample content.
If you want to add some content below your posts, add another div right after these lines near the bottom:
I’ve only created one template page so far (I’m doing the rest in the next few days), and it’s just a sample – you can see the descriptive text at the top of the page on my blog content page. I shouldn’t have to tell you what a new world this opens up for you! Now you can add multiple paragraphs of descriptive content on EVERY category page and (if my SEO WP plugins don’t nofollow them) I can get each category and tag page indexed in google as a “sub-index” or sub-home page of my site. If you have clients with products and services, how much easier will this make it to market their sites using WordPress? All your important pages can have specific information targeting particular keywords drawing new visitor’s right to it like flypaper. Now you almost have something like regular “static” pages in your site that won’t change once initially setup, in addition dynamic posts and blog pages! You have the best of both worlds between a static site and blog.
You can now monetize your site better by placing category or tag specific ads, and if you really needed to with a few minor hacks you could have category and tag specific sidebars as well! If you used the Ad Rotator plugin (I’ll talk about this in a future post), you could have category specific ads rotating in blocks before and after your content on those page, or even “in the loop” with one category specific ad in between each post! The possibilities are endless!
If you benefited from this post, have questions, or something to add to make it even better – please comment now!