Moving Wordpress Title & Symbols

or How I Learned To Show Search Engines Some Love.

The standard Wordpress handling of title tags [what shows up in your browser’s title bar and search engines] is not guite right.

Instead of BlogTitle >> PostTitle; you want PostTitle >> BlogTitle. This helps with SEO and looks better.

You could switch wp_title and bloginfo(name), but then you get this annoying >> before your title. So here is the easy solution without resorting to a plugin.

Add the PostTitle after the Title tag:

<title><?php wp_title(' '); ?>

Add the condition if we’ve removed that symbol, it should add another after it; in this case i’m choosing the | symbol because I don’t like the arrows:

<?php if(wp_title('', false)) { echo ' | '; } ?>

Now add your blog name and whatever else you want before closing the title tag:

<?php bloginfo('name'); ?> | blog description? </title>

Works like a charm. Thanks to Zach.

Tags: ,

This entry was posted on Tuesday, March 4th, 2008 at 11:12 pm and is filed under Long. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

ss_blog_claim=53530d43dc267adc556cf944bc3e7d55