ghacks Technology News

WordPress Blogs: Create Custom Tag Pages

A WordPress blog post consists of a handful of elements like the title and body but also tags, categories and comments. Tag pages usually display excerpts of all posts that use the same tag. One example: If you search for Windows 7 Download on Google you find that a tag page for my website Windows 7 News is ranking on the third page of the results. Tag pages on the other hand are usually not the pages that visitors expect when visiting a website.

Webmasters can however utilize tag pages better in their WordPress blogs by creating so called custom tag pages which can contain any information they want. If you open the page above you notice that it does not contain a listing of blog excerpts but a custom page for that tag.

WordPress provides the means to create those custom tag pages easily. Custom tag pages can be created in the theme directory of the WordPress directory by adding a new template file to the theme. This new template file needs to begin with tag followed by the post slug of the tag. In the case of the Windows 7 Download tag it would have to be named tag-windows-7-download.php.

Custom tag pages have a higher priority than the default ones that show only excerpts of the posts. The easiest way to fill the custom tag with content is the following:

WordPress looks for the following files in order to create those tag pages:

  • tag-slug.php
  • tag.php
  • archive.php
  • index.php

Look into your theme folder and see if there is a tag.php file. If it is copy its contents and create a new php file that is using the tag-slug.php as its name. If ther eis no tag.php look for archive.php and finally index.php.

Now simply add content to the file. It might take some experimentation at the beginning but it can be really worth it in the long run. If you have any questions or additions let me know in the comments.

Enjoyed the article?: Then sign-up for our free newsletter or RSS feed to kick off your day with the latest technology news and tips, or share the article with your friends and contacts on Facebook or Twitter.

Related Articles:

WordPress Custom Tag Templates
Computer Worm Attacks Not Updated WordPress Blogs
WordPress: Customer Headers For Categories
Reduce Page Loading Time With WP-Smush.it For WordPress Blogs
Create Custom Firefox And Thunderbird Installations



About the Author:Martin Brinkmann is a journalist from Germany who founded Ghacks Technology News Back in 2005. He is passionate about all things tech and knows the Internet and computers like the back of his hand. You can follow Martin on Facebook or Twitter.

Author: , Wednesday April 8, 2009 -
Tags:, , , , , , ,


Responses so far:

  1. Everton says:

    Google also monitors bounce rates, so if your tag pages don’t look relevant they will eventually lose their positions, so this is worth doing for any pages on a site that’s getting a lot of traffic.

    I’m glad we added some custom tag pages on Windows 7 and I’m going to check the stats on all my sites to see if I should create more.

    BTW I saw this post on twitter so it really does help promote posts!

  2. Emre says:

    Good. Thanks :)http://www.emrearici.com

  3. Trisha says:

    any pointers on how to seo a tag page to its fullest potential? I had my first natural search visitor to a blog i havent promoted yet. They found me through a tag page. i didnt even know it existed, dont have much backlinking experience;)

    seems it could be pretty powerful if done correctly, and probably would only take a couple tweaks.

  4. Emre A. says:

    Good! Good luck with results.

  5. xfantasy says:

    i want plugin

  6. Roch says:

    What I am looking to do is similar. I am looking to have a static page as well as the blog appear on the main page of my wordpress site. Right now going to the settings section will only allow me to do one or the other. any feedback would be appreciated. Is there a special PHP INCLUDE tag I should be using for both to appear?

  7. amit says:

    my name is amit on my website i want to show all the tags on separate page post how to do that?

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

Subscribe without commenting

© 2005-2012 Ghacks.net. All Rights Reserved. Privacy Policy - About Us