Wordpress Blogs: Create Custom Tag Pages - gHacks Tech News

WordPress Blogs: Create Custom Tag Pages

A WordPress blog post is made up of a handful of elements like the title and content, but also tags, categories and comments. Tag pages usually display excerpts of all posts that use the same tag, and the same is true for category pages.

While you are not required to use tags at all, doing so may improve the accessibility of your blog posts as you can group posts using tags.

One example: If you search for Windows 7 Download on Google you find that a tag page for 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. (note: no longer)

Custom Tag pages in WordPress

Webmasters can utilize tag pages better on their WordPress blogs by creating custom tag pages which may list any information they want. The benefit of this approach is that your tag pages become more unique, as they not only list posts, but also additional information that you add to these pages.

If you open the Amazon tag page here on Ghacks for example, you will notice that it offers a custom description and image at the top before the actual articles are listed on it.

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 amazon tag it would have to be named tag-amazon.php.

custom tags wordpress

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 by making a copy of the tag.php file, rename that copy to tag-name.php, and fill it with custom data at the top.

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 there is 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.

Update: Some WordPress themes use tag descriptions automatically for this. If you fill out the description it may appear right above the tag even if you do not create custom tag pages. The Canvas theme that this site uses does so for example.

Summary
Wordpress Blogs: Create Custom Tag Pages
Article Name
WordPress Blogs: Create Custom Tag Pages
Description
The guide walks you through the steps of adding custom tag pages on your WordPress blog to display unique information on each tag page.
Author
Publisher
Ghacks Technology News
Logo

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. Everton said on April 8, 2009 at 9:24 am
    Reply

    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 said on April 20, 2009 at 9:54 pm
    Reply

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

  3. Trisha said on July 23, 2009 at 7:21 pm
    Reply

    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. said on October 27, 2009 at 3:43 am
    Reply

    Good! Good luck with results.

  5. xfantasy said on January 27, 2010 at 10:29 am
    Reply

    i want plugin

  6. Roch said on April 16, 2011 at 4:08 am
    Reply

    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?

    1. Martin Brinkmann said on April 16, 2011 at 9:48 am
      Reply

      Roch you can edit the index.php file manually to add static content to it. That’s how I have done it on the ghacks front.

  7. amit said on April 16, 2011 at 8:11 pm
    Reply

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

    1. Martin Brinkmann said on April 16, 2011 at 8:14 pm
      Reply
  8. boykalbo said on July 5, 2012 at 2:37 pm
    Reply

    thanks for this, Im going to edit may tag page to be more precise

  9. jobio said on October 27, 2012 at 9:47 am
    Reply

    creating your own or tweaking the tag is really good for seo thanks for additional insights

  10. david said on December 1, 2012 at 10:04 am
    Reply

    Great.. now looking for improve my tag.php

  11. Onewheel said on December 11, 2017 at 2:12 pm
    Reply

    Perfect idea, Helpful, will try it later.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.