As I mentioned in the first article of this series, Search Engine Optimization (SEO) for WordPress, Part 1, I'm fairly new to the SEO arena, being as how I knew nothing to start with and know very little now. I am learning, though.
In this third part of the series, I'm going to focus on how your post titles look to the search engines. Here's how mine looked before I made a change (I'll use my top post as an example):
Untwisted Vortex - Living in a Different Land » Lesbians!
Not too pretty and not too unique to the search engines. Every page search lookup started with my blog name. This is what it looks like now:
Lesbians! - Untwisted Vortex - Living in a Different Land
The difference is that the post title is now up front. This only affects pages OTHER than the front index page. How did I accomplish this feat? Well, there's two ways to do it. The first is to install a plugin called All in One SEO Pack. The second is to edit the theme header.php file.
I had to do the latter because the plugin did not work on my theme, for whatever reason. Instead of trying to hack the plugin, it was much easier to edit the header.php file. The "title" tag area of the file originally contained this:
<title>
<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>
<?php wp_title(); ?>
</title>
I changed it to this:
<title>
<?php if ($_SERVER['REQUEST_URI'] == "/" || $_SERVER['REQUEST_URI'] == "/index.php" || strpos($_SERVER['REQUEST_URI'], "?s=") || strpos($_SERVER['REQUEST_URI'], "page")) {
bloginfo('name');
echo ' - ';
bloginfo('description');
} else {
wp_title(");
echo ' - ';
bloginfo('name');
echo ' - ';
bloginfo('description');
}
?>
</title>
Not too pretty, but it works. The first line prevents showing the post title or other extraneous characters on the front page, the search results page, or when paging through the blog.
The plugin I mentioned serves other purposes as well, so take a look at it and see if it's something you can use. You can always use my code if the post title rewrite doesn't work properly. Some of the other purposes are also covered by other plugins, one of which I use, so I had no need for it.
Tomorrow (or perhaps the next day since my wife has plans made for me to go somewhere tomorrow), I'll continue with the fourth installment. It will probably be the last. In it, I plan to give credit where credit is due and summarize the series. If I add anything else, it will be a last minute thing.



