Show nicer, reverse titles on your WordPress blog
First published on July 15, 2007
By default, WordPress titles (in the title bar of the browser) look something like this:
Title of your blog » Post title
To help people find your blog better (ew, is this a post about SEO?), the order should be reversed, so that your post title comes first. For example, if someone searches for “make your own family feud game” on Google, one of my posts shows up quite high in the rankings. But with the default title, the Google result shows “Peter’s Useful Crap” and then the post title “Make your own Family Feud Flash game”. I’m willing to bet that people care less about the title of the site offering the information than about the specific post.
There are plugins that let you customize optimal titles, but that’s not really necessary. To have a title such as:
Post title | Title of your blog
Use this code in your template’s Header page (header.php):
<title><?php wp_title('', TRUE); if (!is_home()) print ' | '; ?><?php bloginfo('name'); ?></title>
(To edit your template files, visit “Template… Theme Editor” in your WordPress admin panel.)
July 20th, 2007 at 11:40 am
Deena says:
What’s a good way of tracking my hits etc? Right now I have no idea except for when you tell me how many telus monkey searches I get… thanks! : )
October 24th, 2007 at 1:34 pm
George Latimer-Knight says:
Thank you for giving this code. I know its simple, but I am not fimilar with PHP just yet. Peace.