Optimizing Your WordPress Title Tag

February 19, 2009 // Author: Jacob Stoops // 566 views // View Comments
Optimizing Your WordPress Title Tag
Learn how to optimize your Wordpress title tag without the use of a plugin.

Optimizing your WordPress site’s title tag should be very easy, however by default it’s not. If you don’t know anything about SEO or PHP, then it may be difficult for you to get your WordPress Title Tags to format that way you want (and in an SEO-friendly manner).

In a normal website, your <title> tag is located somewhere in the <head></head> section of your site. This is the same for WordPress, however since WordPress pages are dynamically generated using PHP you will need to go into the ‘header.php’ file to find your site’s <title> tags.

By default, the <title> tag will be formatted like this:

<title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>

This will pull your blog’s name (that you determine in the setting), followed by the name of whatever page you are on. For instance, if you are on your ‘About’ page, your title will automatically format like this, “Blog Name | About”.

From an SEO perspective, this isn’t totally optimal, as I will explain below.

My Company Name Doesn’t Help My Rankings?

For many people the default format is perfectly fine. However, many websites & companies don’t have a company or site name that is very search-friendly. That is, the name of the company or site doesn’t really include “quality keywords.”

For people with this problem, you may want to place extra emphasis on your site’s pages rather than your biz name. Search engines place extra weight to keywords towards the beginning of your title, therefore you may achieve higher rank by creating shrewd page names using highly-targeted keywords.

For this, we can use a quick fix. Simply flip around the title tag elements so that your page names are listed first. It will look like this:

<title><?php wp_title(); ?><?php bloginfo(‘name’); ?></title>

From an optimization standpoint, this will help you a bit more if your company name isn’t too search-friendly. Just be shrewd in the naming of your pages and articles and more weight will be placed on them with this format.

Search-Friendly Company Name or Strong Brand?

If your company name includes good keywords or your brand name is highly recognizable, you may be able to get the best of both worlds.

If this is the case, you’ll want to use your all-powerful homepage title to focus on your company name first, followed by a description of your services (or a page). Then on the subpages, you’ll want to focus more on your services, etc.From an SEO standpoint, this is the BEST option and allows the most flexibility.

Using my blog as an example, I wanted the focus of my homepage title to be on my blog’s name followed by a short snippet of what the blog is about.

However, on the subsidiary pages I wanted to focus more on each individual article, so I wanted the name of the article first followed by my blog’s name.

I use the following code (feel free to make mods to the bolded text):

<title><?php
if (is_front_page()) {
echo bloginfo(‘name’);
} elseif (is_page()) {
echo wp_title(”); echo ” | “; echo ‘Your Site Name‘;
} elseif (is_single()) {
echo wp_title(”); echo ” | “; echo ‘Your Site Name‘;
} elseif (is_404()) {
echo ’404 Not Found’; echo ” | “; echo ‘Your Site Name‘;
} elseif (is_category()) {
echo ‘Category:’; wp_title(”); echo ” | “; echo ‘Your Site Name‘;
} elseif (is_search()) {
echo ‘Search Results’; echo ” | “; echo ‘Your Site Name‘;
} elseif ( is_day() || is_month() || is_year() ) {
echo ‘Archives:’; wp_title(”); echo ” | “; echo ‘Your Site Name‘;
} else {
echo wp_title(”); echo ” | “; echo ‘Your Site Name‘;
}
?></title>

As you can see, this tag utilizes WordPress’ Conditional Tags, which I absolutely love.

Basically, on the homepage my blog name is following by my blog description (these are both controlled in the settings). On every other type of page (single post, page, category, 404 page, search results page and archives page) the title is formatted to show the name of the page or article first and then my blog’s name.

This will place heavy emphasis on my blog name in the homepage, as well as allow my to customize the rest of my title from the settings panel. Then on my subpages, more of the emphasis will be placed on my article titles, etc.

I recommend using this option, as it allows the most flexibility in terms of SEO of the homepage, and places the most emphasis on your site’s content and titles.

In my next article, I’ll show you how to create Conditional META Descriptions, that produce a different META Description for each page of your WP Blog.

Also, if you don’t want to do all of this, you can use the WordPress All-in-One SEO Plugin.

Like This Post? Why Not Share it.

Related Posts

If you like this post, then you might like these as well!

  • i think Portal where web designers, developers and programmers have the belief that development should be done different ..
  • ericafiller02
    How does WordPress handle the title tags for your blog, ... to tweak your WordPress template in order to optimize your title tags for better
  • Thanks for the code. Very useful.
  • Nice tips on strengthening wordpress title tag. Thanks for the code.
  • Very nice information. Thanks for this.
blog comments powered by Disqus