Jun 252010

One of the easiest things you can do is define a clear and simple Title tag for all of your Blog Posts and implementing this in your Header.php file. You will often want to override whatever theme default is being set and in many cases by doing this manually you can avoid the overhead of adding another WordPress plug-in that just adds a custom title tag to your blog post. The ‘Title’ tag is the name that your post displays at the top of the browser when the page is visited, and it also is the “Title” of your article that gets picked up and displayed on Google Search engines:

Typically what you want to do is keep your title clean, any blog themes will have || or >> characters as part of the Title tag which don’t translate well and provide no SEO value, they also interfere with your ability to submit your articles cleanly to sites like BlogEngage, Digg or other directories.

I decided to make my own custom Title tag in my blogs and simply use this line of text inserted into my Header.php after the <head> tag:

<title><?php if ( is_single() ) { echo wp_title(“”,true) . ‘ on ‘ . get_bloginfo(‘name’); } else { echo get_bloginfo(‘name’) . ‘ for ‘ . get_bloginfo(‘description’); } ?></title>

What the above code will do is set your Title tag to just be your “post title” if it is  apost, and if it is  your homepage or archive, search or any other page, it will use your blog name for <blog description>

so for DragonBlogger.com you can see my title for my homepage becomes:
Dragon Blogger for Blogging Tips, Technology news, with Movie Reviews and Entertainment posts mixed in for fun.

and my posts themselves have a title of just the “post name” on “Dragon Blogger”

I like having my blog name/handle in the title of all posts so users who search for articles can see my identity and handle in the title, or else they may not easily know which site the article is located on.  This is a matter of preference but in my opinion you should make it as easy as possible to identify which site or who the article is attributed to on Google search results.

This code is easily modified and you can use it for just about any blog theme, just remember to backup your existing header.php first and then replace your original <title> tag in your theme with this tag above.  You can tailor it if you need to, but this is a good alternative to using a WordPress plug-in.

-Dragon Blogger

Justin Germino
Working in the IT Industry for over 13 years and specializing in web based technologies. Dragon Blogger has unique insights and opinions to how the internet and web technology works. An Avid movie fan, video game fan and fan of trying anything and everything new.
Justin Germino


Technology, Gaming and Wordpress blogger who runs gadget giveaways, helps others with blogging tips, monetization, earning and more!
Freemake Video Converter: Top 10 Hidden Gems for a Techie https://t.co/Q7xh9Tup8O - 23 mins ago
Justin Germino
  • AJ

    Great post. The title tag SOOO important to SEO efforts (probably the most important on page factor). I create post titles that reflect the keywords that are important to me and use these as my page title as well.

  • This feature is included in Platinum SEO so I don’t have to modify the code. I often use my Title tag like this: “clean title – my blog name”, is the dash OK or I should change it to a word?

    • Dash is fine, I haven’t seen it truncated, but definitely don’t use or | or ‘ in the Page Title as those characters are “script” triggers and can cause breaks in various web applications.

      • Oh now I understand why my title was truncated when I use “” in the title. Thanks for your post and response.

  • I was trying to make a tag for every post title in certain category.


    All the posts that fall under Cat: A — will have this following title:
    “[A] Post Title 1”
    “[A] Post Title 2”

    I tried to add

    <?php if (is_category('catnumberhere')) {
    [CAT TAG]

    } ?>

    • I don’t recommend using the same title for all posts in the same category, they would have trouble indexing on Google which for searching is best to have a unique title per post.

      • Will Google penalize blog with repeating same title keyword phrase? Is it better to put it in URL for SEO purpose?

        Such as these title “iPhone App – nice app” and “iPhone App for Business – Download it for office use”

        • I don’t know if Google Penalizes, I just know when your site is indexed for Google I don’t think its a good think to have the same TITLE for every post in a category. I think it hurts your chances of getting your page indexed. If someone knows more detail I would love to hear it.

  • I recommend to all beginners in the SEO using the All In One SEO plugin for WordPress because it is the best and automates all these operations work philosophy that often tend to be tedious. Greetings!

    • I use the All in One SEO Pack myself, the only thing is many hosting providers complain about the amount of Memory it utilizes, I have had many blame it for causing blog to use lots of RAM/CPU. It does add some overhead.

  • I use AllInOne SEO, as well, and I get what I think is the right combination of Post title | Blog Title. I’m happy with that unless anyone thinks otherwise?

  • All in one SEO plugin does this work for me. But I am planning to stop using plugins like AIOSEO and using PHP codes as they reduce the loading time of the page. Thanks for this one!

  • I’ll pay more attention to the title tags on my posts. They’re important for SEO and enticing readers.

    I’ve used All In One SEO in the past, but now all my blogs run on Thesis, which has SEO capabilities built in.

    • By default AIO doesn’t set the Title you have to check mark the option int he settings, but ultimately using a theme with SEO built in may have performance advantages (or not) if the theme is poorly coded.

  • I like having my blog name in the title along with the actual post title. I think it serves to help brand the site better. If I was building a niche site though for the specific purpose of organic search engine traffic then I absolutely would remove the extra blog name from all titles.

  • Intesting code, might try later on my test blog, i have heard there is a plugin how to clean this post url, however because i try to decrease plugin usage, this code seems to be useful.

  • amit@ website design company

    I have a very good example of title tag power.Last week I create a blog and I have post my most target keyword in title and my blog url and title tag are same.You ll not imagine I have submit it to Google in the evening and next morning my blog with that keywords was on second page and also was cached.I think this is a big example of title tag power.