View Single Post
Old 08-05-2007, 10:13 AM   #2 (permalink)
PeteYoung
Junior Member
 
Join Date: Apr 2007
Posts: 4
Default Re: Wordpress titles without junk

Quote:
Originally Posted by Brian Turner View Post
One thing I find really annoying about Wordpress - the default page titles.

From a SEO standpoint, you really just want the page name in the title - but Wordpress throws in Site name >> Page Name.

It should be simple to edit - after all, the default Wordpress title appears as:

Code:
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
So what it you remove bloginfo from the title, ie?

Code:
<title><?php wp_title(); ?></title>
Then your page titles become an annoying:

>> Page Title

Here's the fix:

Code:
<title><?php wp_title(($sep = '')); ?></title>
By using this, you tell Wordpress to only display the page title as the actual title - as before - but with the small tweak of declaring that you do not want a separator (ie, &raquo; ) in there.

So apply that you end up with:

Page Title

as your title.

A very simple, but bloody useful tip.

Thanks to Bruce Lawson for that, and there are a few more small - but useful - editing tweaks here:
http://www.brucelawson.co.uk/2005/wo...ibility-hacks/


ADDED: Okay, that removes the blog name from the index page. Damn. Need to find an expression to allow wp_title in posts AND categories, while allow for bloginfo in the index.

Otherwise, a simple work around:

Code:
<title><?php wp_title($sep = ''); ?>: <?php bloginfo('name'); ?></title>
Which displays:

Page title: Blog name
Theres a plugin on the main Wordpress site that does all this for you - well you provide the bespoke paramaters, or else it defaults to your example at the top
PeteYoung is offline   Reply With Quote