Looking to optimize your WordPress title? 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’s search engine potential. 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.

Optimize Your WordPress 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(‘name’); }
elseif ( is_category() ) { single_cat_title(); echo ‘ - ‘ ; bloginfo(‘name’); }
elseif (is_single() ) { single_post_title();}
elseif (is_page() ) { single_post_title();}
else { wp_title(‘’,true); } ?></title>

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

If you’re truly ambitious, you can actually use a plugin that will do all the dirty work for you. That plugin is called WordPress SEO, and it will help automate the process for displaying completely custom meta tags for each page of your blog, including the title field.

Kyle Eslick is WordPress enthusiast who took his passion for WordPress to the next level in 2007 by launching WPHacks.com as a place to share hacks, tutorials, etc. Connect with Kyle on Twitter or Google+!

  1. Raju says:

    Real useful tip!!

  2. Cody Taylor says:

    Good tip. I’ve actually been using the all in one seo plugin for quite some time and it’s great.

  3. Alex says:

    Most handy tip, just what I was looking for.
    I tweaked it a tiny bit to use a » instead of the dash and had a little problem – I had copied and pasted the code above into Notepad and instead of the single quote characters (‘ ‘), it pasted little 6 and 9′s. I had to replace these with the single quotes and it works fine.
    Thanks again,
    Alex.

  4. didid says:

    Hi, nice post.
    In order to avoid duplicate content, I try to include pagination number on title. What is the codex on WP 2.6 and higher? I use “?php echo $paged; ?” but the first page always shows “0″. In WP 2.3 it works. Please help. thanks

  5. szuman says:

    Good tip. Thanks

  6. waterlife says:

    all in seo pack more useful for beginners.

  7. Sanjay says:

    Nice one bro! The Seo plug did the trick much easier. Thanks for sharing this great information

  8. jam says:

    thanks so much ! i hate plugin so i will use this code instead

  9. Naveen says:

    as you mentioned All-In-One SEO Pack is one of the best plugin for any WordPress blog. This really increase the SEO of your blog. I personally advice it to any blogger and I have this plugin installed in my blog. Thanks for the useful tip by the way :)

  10. cesi says:

    i couldnt succes on PHP 5.3.2, any body can help ? thank you

  11. Usman says:

    I like to use code instead of plugins

  12. VoIP Writer says:

    I don’t want to continue my blog title after my page title but i don’t know how to do it. I am using All In One Seo Pack plugin and i had removed the %blog_title% which was after %page_title%. But it is still continuing. In header.php title code is, and in page.php title is . What should i do, so the blog title will not continue after page title.

Trackbacks/Pingbacks »

  1. 63 essenziali Wordpress Hacks, Tutorials, Help Files e Cheats : technorati.it says:
  2. Wordpress Tutorials/Hacks « The house of software freeware says:
  3. IndoProTech.com says:
  4. 63 correções, tutoriais, arquivos de ajuda e dicas essenciais para Wordpress | Rafael Bernard Araújo says:
  5. Wordpress Hacks, Guides and Tricks | TechnoBuzz.net says:
  6. WordPress ?? ??? ??? snippet says:
  7. WordPress ?? ??? ??? tutorial says:
  8. Top 30 Most Wanted Wordpress Tricks and Hacks | Make Money Blogging Experiment says:
  9. Wordpress ile ilgili 155 kaynak « YEAH28 - Her ?ey Sizin ?çin says:
  10. Best of WordPress Tutorials – More than 100 recourses | Tutorials | .:Lirent.net Hacks:. | All about Web 2.0, SEO, PHP5, Ajax, Adsense, Unix/Linux, Free Stuff, OpenSource, Designs, Wordpress, Hi-Tech etc says:
  11. 36 New Wordpress Tips, Tricks, Tutorials & Hacks | TechnoBuzz.net says: