Optimal Title Tag Code For WordPress

HTML title tags are, arguably, the single most important SEO ranking factor. Nailing the title tag could be the most important thing you do all year in your blog’s SEO campaign. Yet the average blogger simply inherits her WordPress theme’s title tag, without shaping it into SEO perfection. In this article I’m giving you the code for what I think are the two most optimal WordPress title tags.

I’ve been using the “Cutline” title tag code for the longest time, assuming that it was the best out there (and in some cases, it very well may be). But the other day, I decided to question all my basic blogging assumptions and re-think some critical questions from scratch. Having done that, I’ve come up with the following SEO optimized title tag code to place in your header file:

<?php if (is_single() || is_page() || is_archive()) { wp_title('',true); } else bloginfo('name'); ?>

This is optimized for SEO, not necessarily for usability. For example, if branding is important to you, you might prefer the Cutline title code, a version of which I include here:

<?php if (is_single() || is_page() || is_archive()) { ?><?php wp_title('',true); ?> | <?php } bloginfo('name'); ?>

The main difference here is whether or not the name of your blog gets included in the title of every page. It is my view that by putting your blog title in the title tag of every post, you dilute the SEO value of your article’s title.

11 thoughts on “Optimal Title Tag Code For WordPress

  1. I agree that the title tag is the most important issue in on page SEO without a doubt. But how do you feel about all this social stuff everyone are talking about?

  2. Thanks Ahmed for the explanation and example of the title function. I’ve searched everywhere before the code you post, I was looking for something like that since WP don’t seems to manage very well the default titles…

    Now all works like a charm.

    Thanks to the post and one special to Achmed!

  3. why all are manipulating and playing with Code? Most easy way is to use all-in-one-seo-pack plugin, just install it in one minute. you can check my blog title result in google

  4. <?php if(is_home()) { bloginfo('title'); echo ' - '; bloginfo('description'); } else{ wp_title(''); echo ' | '; bloginfo('title'); echo ' - '; bloginfo('description'); } ?>

    The above is a simplified version of the WP title code that shows your page’s title tag in this order:

    Blog Name – Blog Description (Home page)
    Page Name – Blog Name – Blog Description (All other pages)

    There’s a very specific reason why I use that configuration on one of my blogs, and each segment has it’s purpose SEO-wise.

    Mainly though, I agree with Ryan’s statement that:

    It is my view that by putting your blog title in the title tag of every post, you dilute the SEO value of your article’s title.

    But I would add that search engines, when placing a value on a particular link, also evaluate the page that link is coming from, and since title tags are one of the most important components of a page’s SEO, it stands to reason (for me) that the keywords in a page’s title tag will have an impact on the ‘link juice’ any link from that page sends out.

    So if your blog name has your main keywords, then include it in your title tag. If it doesn’t, consider the branding impact and add it nonetheless. If your blog description has your main keywords (it should), add it to the title tag.

    Usually you should have your title tags as ‘focused’ as possible. But for some search phrases, just having all your site’s pages include that search term can take you from nowhere in the SERPs to #3 in Google (true story). So it works, if you make it work for you.

  5. if your site name is keyword rich, there is always the possibility that the post-title + site-title combination will create interesting, maybe even powerfully reinforcing phrases.

    For example, on my blog One Big Maine which is a blog about Maine. Chances are that every blog post is somehow related to Maine. So it could be advantageous to leave the site title up *after* the blog post.

    However, on a site like RideLust (a car blog) – the title does nothing to help with SEO and SERPS.

  6. chuck,
    the cutline title tag (above) became famous, in some part, because it was the first major theme to put the post title first.

  7. eTech media…why do you think it’s funny? The authors of Performancing, between them, over 100 WordPress blogs. Doesn’t it make perfect sense that we’d talk about a blogging platform that we use?

  8. Hrm, interesting subject – while the site’s name may dilute the value of the article’s title, would there not be the opposite effect in some cases – if you’ve built a strong brand around your site’s name, I presume that would reflect well in search engines. (Take that with a grain of salt – I’m not terribly familiar with the intricacies of SEO.)

    I think what deserves more attention is the order in which they appear in the title. Most of the themes I’ve seen, for WordPress at least, put the title of the site before the title of the article. In fact, the way to reverse their order is not as straightforward as it perhaps should be. Just logically speaking, I’d think having the title of the article first and foremost should do something for search engine rankings of those articles.


  9. So funny that this blog, made with Drupal, gives most of the time WordPress tips.

Comments are closed.