Page Title
Earlier on, we talked about optimising the permalinks, and now we'll talk about the page title of your Wordpress blog:
2. Page Title
By default, Wordpress sets your page title to be like this:
"BlogName » Blog Archive » Post Title"
What we want to do is to swap the position of "Post Title" with "Blog Name". This is because:
- Search engines uses your Page Title as the linking text in its search engine results page (SERP).
- The search keywords are bolded for page titles in search engines
- It makes it easier for search engine users to know right away if what they are looking for is correct
Now, this will involve some editing to your template files, which is normally called "header.php". Find this:
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
and replace with:
<title><?php wp_title(' '); ?><?php if(wp_title(' ', false)) { echo '–'; } ?><?php bloginfo('name'); ?></title>
And you're done!


May 14th, 2006 23:27
[…] Continue to "2. Page Title" […]
May 14th, 2006 23:28
[…] We have so far covered Permalinks and Page Titles, so now I would like to introduce a plugin called Google Sitemap Generator. […]
May 15th, 2006 03:31
[…] 1. Permalinks - changing your Wordpress permalinks to be search-engine friendly 2. Page Title - improve the readability of your blog posts 3. Google Sitemaps - creating a sitemap for your blog 4. Tagging & Meta Keywords - implementing tags on your blog and how to use them as meta keywords. […]
June 6th, 2006 12:11
I've tried this and its not working. Do I add or change anything to this line…
June 6th, 2006 15:58
ok, try copy and pasting the code again 'cos wordpress displays the quotation marks with fancy characters, I've made some changes so it should be fine now!
cheers.
June 7th, 2006 06:38
Excellent. Thanks!
June 28th, 2006 09:15
[…] http://seo.blorc.com/seo/page-title/ Filed under: wordpress | […]
September 11th, 2006 10:13
[…] http://seo.blorc.com/seo/page-title/ Bookmark to: […]
October 10th, 2006 20:59
Hi.
I have problem with page title.
When I enter in header.php this
I get ? mark before >> in page title. Here is how it looks
Action?» mangiaphoto
How I can remove ? mark
October 10th, 2006 21:30
i guess it's the echo '-' part you're talking about, replace the - with anything you want e.g. »
October 10th, 2006 21:36
thanks
this solved my problem.
October 19th, 2006 01:21
Hey,
I think there's a slight problem with this. Using this approach it inserts spaces before the title tag. I've tried prefacing it with 'trim' but it doesn't seem to strip it out either so I'm kinda stumped.
Further info and alternatives are at: http://wordpress.org/support/topic/63186?replies=12
Cheers,
Joe
July 16th, 2007 00:29
If you use wordpress 2.2.x, try All In One SEO PAck from uberdose (http://wp.uberdose.com/2007/03/24/all-in-one-seo-pack/), it will do the trick without editing any file.