Better SEO Titles in WordPress 2.5

A bane of WordPress development for a long time were the awful titles generated for blog posts. When I speak of this I’m talking about the order of the blog title and the post title are put together. An example of this can be found below.

Bad Title

And this example is better than other’s I’ve seen. On some sites where the blog/post title is long then the post title is truncated! This is unacceptable when search engines give so much weight to the content of your post titles.

For a long time I circumvented this behavior by using the Optimal Title plugin. It worked fine, but it was yet another plugin for something that should’ve been inside the core. So I opened ticket #4407 to integrate the plugin architecture into the core. I created a patch, and it became changeset 6,538! In short, I added a parameter into wp_title() that sets the location of the separator. By default, it goes to the left, but you can move it to the right by specifying it. If you don’t specify anything it defaults to the legacy behavior of going to the left.

This is the code you can now use to generate sexy SEO titles:

<?php wp_title('&raquo;',true,'right'); ?> <?php bloginfo('name'); ?>

This will print: Post/Page Title » Blog Name. By ensuring that you specify meaningful titles for your postings then you can ensure that your findability will increase.  The official documentation on this function has also been updated to include this change.

4 Responses

  1. Josh Highland March 31, 2008 / 7:50 am

    Good job. That has to be a great feeling, getting one of your changes added to the core like that. Keep up the good work

  2. Chris Poteet March 31, 2008 / 11:23 am

    @Josh: Yes it does feel good to give back to an application that has given a bunch to me.

  3. Justin Kohnen April 10, 2008 / 10:06 pm

    Nicely done, I agree titles are a HUGE asset for SEO. Keep up the good work man.

Comments are closed. If you have a question please contact me.