Ultimate Guide to WordPress SEO - Optimized Titles

October 7th, 2008 Nathan Rice

Arguably, one of the most important elements of a website from an SEO perspective is what comes between the <title></title> tags in the header of your page. Take a look at any search result page in Google and you’re probably looking at a list of websites with big blue links … and the text of those links is none other than the text Google found between the <title></title> tags when crawling the page.

So, this next post in our WordPress SEO series will cover how to control what gets displayed in that section of our site, and thus not only controlling what the Search Engines display as the title of our post/page in results pages, but also leveraging a powerful tool for ranking for those keywords we’re targeting.

While the complete order of tag importance is debated, one thing is for sure: the <title> and <h1> tags are definitely at the top in terms of importance for search rankings.  Think about your tags as a means of communication with the search engines rather than display elements.  What you put between the <title></title> tags is considered by the search engines to be THE MOST important information about the page it is viewing.

So, being able to control this is vitally important.

Structure

If you look at just about any WordPress theme worth its salt, you will find the title generating code in the header.php file, and it will look something like this:

<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

As you can see, we are going to be doing some intermediate code hacking in this tutorial, so be prepared.

What you’re seeing are called “Template Tags” and they are what WordPress Themes use to display dynamic content that is being stored in the database.  For a complete list of these template tags, view this Codex Page.

The template tags we’re interested in are wp_title(), bloginfo(’name’), and bloginfo(’description’).  Respectively, they output the title of a single post or page and the name and tagline of your site (as defined in your Settings).  Many themes have started optimizing this section automatically, and some have even gone as far as using many conditional tags to display specific information related to various archives (tag, category, date, etc.), but I have found it more than adequate to optimize for Single Posts, Pages, and your homepage.

The Default Theme

The default theme structures it’s <title> text like such:

<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

Now, this format is actually bad for SEO, since the content it puts first is the title of your blog/website.  Remember how results pages in Google show the content of the <title> for results?  Well, if you want people to actually click on your page/post when viewing reults, then you need to give them the title of your post/page as soon as possible.  The most irrelevant part of your titles is your blog’s name.  So, move it to the end instead of the beginning.

Here’s a quick way of doing it:

<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :: '; } ?><?php bloginfo('name'); if(is_home()) { echo ' :: '; bloginfo('description'); } ?></title>

In a nutshell, this code does the following — if viewing the homepage, it will display “Title of Blog :: Tagline of Blog” — and if viewing a single post or page it will display “Title of Post :: Title of Blog”. This puts your most important content first!

You Don’t Need a Plugin

I know that a lot of you out there are screaming at your screen for me to just recommend using a plugin like the All-In-One SEO Pack, which will handle this <title> optimization for you, and even give you more options than you can get by modifying your theme.  That’s true, but please hear me out …

Yes, I do believe in using themes, not plugins, for outputting HTML that will be publically visible.  But if you insist on using a plugin, then let me please encourage you NOT TO USE a certain feature of the All-In-One SEO Pack.  That feature would be the “Custom Title” feature, which will allow you to use title text other than the text in your ACTUAL post/page title.

Some people find this advantageous because it allows you to “keyword stuff” their title, and game the system.  But in my opinion, if this continues, the search engines will downgrade the value of the <title> and hurt everyone’s rankings.

So, as an alternative, if you want to use keywords in your <title>, then you need to use them in the ACTUAL title of the post or page.  And using the method I outlined above will do that very thing.  I’m certainly not discouraging you from using keywords in your Title, but if it can be avoided, for the sake of the future of your content, make the <title> and the Post/Page title exactly the same.

Tomorrow, we’ll be talking about header tags — when to use which tag (h1, h2, h3, etc.) for the most SEO benefit. Don’t miss it!

Similar Posts:

The Tags: , , , , , , , , , ,

19 Responses to “Ultimate Guide to WordPress SEO - Optimized Titles”

Lee Said:

You’ve got a great SEO series here Nathan. SEO techniques are often neglected, especially in Wordpress blogs, and simple techniques like optimizing the tags and permalinks can make a huge difference. Keep up the good work!

Comment made on October 7th, 2008 at 11:12 am
Angel Cuala Said:

As a newbie in WP, I have been looking for some SEO tutorials that are reader-friendly and I am glad you are among them.

Anyway, I got my free theme from Daily Blog Tips so I think I made the right choice.

But then, I will look at it and find how I can improve it more through your tips.

I am just sure if Daniel (Daily Blog Tips owner) will allow me to have some changes.

By the way, I just subscribe to your blog.

Thanks!

Comment made on October 7th, 2008 at 9:51 pm
Scott Ellis Said:

Nathan,

While I agree that people should use the title manipulation of the All-In-One-SEO plugin to game the system, they could use it just as easily to put in the actual title of the post (consistency) followed by whatever they want without having to manipulate any code, which is advantageous to those a little less familiar with doing so. If there is a disadvantage to doing so I’d be curious to hear your take. I wrote a post a while back on Images and SEO so please take a look, if it is all useful in your series I’d be happy to hear any suggestions or counter arguments.

http://www.vsellis.com/technology/search-engine-optimization-images/

Comment made on October 8th, 2008 at 11:20 am
Scott Ellis Said:

whoops… :) Read “people should use” as “people should NOT use”

Comment made on October 8th, 2008 at 11:22 am
Nathan Rice Said:

@Scott Ellis:
But that’s exactly what the “whatever they want” would be — gaming the system. I’m not saying to never use it, but the abuse of that option is going to come back around eventually. My best guess is that Google will start to penalize users whose TITLE and H1 do not match.

Remember back when search engines used to put a high priority on META Keywords? And as soon as users started abusing that (using Keywords that had nothing to do with the post), the began devaluing them, enough to where they became a far less significant SEO tool than they were before.

That’s my fear for using different text for your TITLE than the actual title of your Post/Page.

Comment made on October 8th, 2008 at 11:41 am
Cezar Said:

great tip.
i would mention that you seem to have forgotten o close the } at the end of description.

Comment made on October 9th, 2008 at 4:44 am
Scott Ellis Said:

@Nathan

Understood, but “whatever they want” could also be “post name - blog name.” Those who will choose to game the system will do it whether or not they use the All-In-One SEO Pack.

I think all we can do (as you have done) is encourage people not to abuse it.

Comment made on October 9th, 2008 at 9:19 am
Nathan Rice Said:

@Scott Ellis:
True enough. But then again, that can be done by a single line of code in the header.php file, and the change would be permanent. But sure, as long as you’re not gaming the system, using the SEO pack for that purpose will probably have zero adverse effect.

Comment made on October 9th, 2008 at 10:28 am
Nathan Rice Said:

@Cezar:
Indeed I did. I’ll try to get that fixed ASAP.

Comment made on October 9th, 2008 at 10:29 am
erica stjohn Said:

I changed my theme so it uses this thanks!
I did have to change

{ echo ‘ :: ‘; bloginfo(’description’); ?>

to

{ echo ‘ :: ‘;} bloginfo(’description’); ?>

to get it to work.

Comment made on October 13th, 2008 at 2:41 am
Joel McLaughlin Said:

WOW. Great post, I am going to integrate this in to my Wordpress pages.

Comment made on October 15th, 2008 at 2:28 pm
Nathan Rice Said:

@Joel McLaughlin:
Hope it helps a lot!

Comment made on October 15th, 2008 at 5:59 pm
Shawn Said:

Greatpost Nathan. I do need some help though. I placed the code in my header like you wrote above

It works however I get the “::” signs between my title and blog name.

Any idea why.

Comment made on October 22nd, 2008 at 11:20 pm
Nathan Rice Said:

@Shawn:
Those are supposed to be there.

Comment made on October 22nd, 2008 at 11:23 pm
Shawn Said:

Now i notice them on yours. Thanks I thought something was funny. Appreciate your help!

Comment made on October 22nd, 2008 at 11:25 pm
Hans Said:

This is really funny. I just discovered the SEO plugin and thought it would be good for my SEO to alter the title tag.

Yesterday i spend about 4 hours trying to get something done with custom fields to alter the title tag.

I thought up until know that the title tag was a overall description of the page rather than just a ‘copy’ of the h1 tag.

But somehow this topic keeps me wondering. Is it really “gaming the system” to alter your title tag? what if the content in the title tag comes back in the overall content? Why would that be bad? If you keep the title reasonable without to much ’stuffing’ would it really damage your seo or would you just feel bad because your ‘gaming’ the system?

Don’t get me wrong I’m really new to SEO and im always skeptic about what people say unless they proof something. I love the Internet and if someone (anyone?) would proof that it is absolutely bad to alter the SEO tag I will be glad not altering the title (saves my time you know).

WOW, great post! this is a new record of the longest comment i have ever written :)

Comment made on October 29th, 2008 at 7:53 pm
Fantasticfreehosting Said:

Again thanks for the post.

I am seriously thinking of deactivating ‘All in one seo’ plugin and just implimenting the advice given on these pages to see what results I gain.

Thanks :)

Comment made on November 23rd, 2008 at 6:37 pm
Sebastin Said:

I have an issue when there is pagination for Home / Category pages. While analizing the content with Google Webmaster tools, it complains of (duplicate title tags and duplicate meta descriptions) for those pages.

That is because the title and description are same for the paginated pages.

Can you suggest a hack to add page number (or some good idea) to title and description please?

Comment made on December 17th, 2008 at 9:19 am
Mazri Said:

i prefer using plugin coz it is easy. Just plug and play.

Comment made on December 31st, 2008 at 2:51 am

Trackbacks

 

Leave a Comment