Wordpress Hacks to Optimize WordPress Title

Digg this

While this blog will probably not get to caught up in covering search engine optimization, there are definitely a few tweaks that you can make to your existing WordPress theme that will help optimize your blog. In this post I’m going to cover a quick adjustment that you can make to your title tag to show a more optimal title.

By default, your WordPress theme will likely come with a pretty standard code for your blog’s title. It probably looks something like the following:

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

Unfortunately this is not the best way to code your title for your WordPress. Ideally, you’ll want a more search engine friendly way to display a custom title for each page of your WordPress blog. In order to achieve this, here is the code I recommend using:
<title><?php if (is_home () ) { bloginfo(%u2018name%u2019); }
elseif ( is_category() ) { single_cat_title(); echo %u2018 - %u2018 ; bloginfo(%u2018name%u2019); }
elseif (is_single() ) { single_post_title();}
elseif (is_page() ) { single_post_title();}
else { wp_title(%u2018%u2019,true); } ?></title>

This code will actually display a custom title for each different type of page on your blog automatically.

Related Posts by Categories



Widget by Scrapur | Scrap Book

0 comments: