WordPress Tip: Reorder your Title Tag
WordPress, by default, creates <title> tags that look like this: <title>Yoursite » Your Post Title</title>. Many people want to use <title>Your Post Title » Yoursite</title> instead, to give more importance to the mutable part of the <title>. There are plugins to do this, but I’d like to show you how a simple change in your theme can accomplish this task. Caveat: this only works in WordPress 2.5 and above.
- Open your
header.phptheme file (if you don’t have one, openindex.phpor whatever one has your <title> tag) - Look for:
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
(or something similar) - Replace it with:
<title><?php wp_title('»', true, 'right'); ?> <?php bloginfo('name'); ?></title>
The first wp_title() argument is the separator character. I like » (which looks like: »). The second argument is whether to echo (print to the browser) the title, or to return it. We want to print it, so we put true. The final argument is where the separator should go… on the left or on the right. We want right, so we put "right". Simple enough!
Update: I got confirmation from Matt Cutts at Google that this is better for SEO.

It should be noted that the new ‘right’ optional parameter is new to WordPress 2.5, so you must be using it to do it this way.
If you have an older version of WordPress, use the Optimal Title plugin instead.
Otto
April 23, 2008 at 12:55 pm
will give it a shot
thanks for the tip
propaganda press
April 23, 2008 at 1:32 pm
Otto, thanks — updated the post to reflect that.
Mark Jaquith
April 23, 2008 at 1:33 pm
good call Mark.
I’ve been using the optimal title plugin for a while now to get the same effect as what you’re showing.
it’s really helped in the search engine results, I feel.
I actually have a file dedicated to my because of how many different variations I have for it.
Jonathan Dingman
April 23, 2008 at 1:56 pm
Is there a way to do parenthesis like kottke.org?
http://www.kottke.org/remainder/08/04/15507.html
Trevor Turk
April 23, 2008 at 2:24 pm
Ahh. Thanks for the WordPress tip there! I’m curious to know if it is okay for SEO if I had used other special characters like ♥ in place of the right angle quote character that you had shown in the tip?
Daniel Richard | Winning Everyone
April 23, 2008 at 2:53 pm
Thanks for the EASY tip.
usedbongs.com
420bay
April 23, 2008 at 4:39 pm
Daniel, I can’t say for sure. I would guess that such characters would be ignored.
Mark Jaquith
April 23, 2008 at 5:18 pm
I’ve been too lazy to switch this, but you gave me the nudge I needed. Thanks Mark!
Bryan Villarin
April 23, 2008 at 5:57 pm
In addition to SEO, starting with the more specific title is also good for any situation where titles get put in a list — lists of articles, bookmarks, tabs, etc. — because it makes the important part easier to spot while skimming.
Kelson
April 23, 2008 at 6:13 pm
[...] Gefunden bei Mark. [...]
Optimaler Seitentitel in Wordpress 2 » Peruns Weblog
April 23, 2008 at 8:23 pm
Lol. I tried using the heart. It looks weird on the title bar so I had it ignored and revert back to the angled quotes. Haha.
Thanks for the tip guys!
Daniel Richard | Winning Everyone
April 23, 2008 at 10:43 pm
[...] Оригинал. 24 апреля 2008 | комментарии RSS 2.0 | trackback | Tags: tricks [...]
Изменение тэга TITLE в WordPress @ inforedesign
April 23, 2008 at 11:51 pm
Another SEO fix will be include a tag such that when there is no title, the blog name show up first, like on the home page or paginated pages, archives, search results etc. Code below.
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' »'; } ?> <?php bloginfo('name'); //SEO FIX ?></title>
hso
April 24, 2008 at 12:53 am
wow! nice.
it’s good for SEO.
Mus_
April 24, 2008 at 1:01 am
Hm, there IS a plugin that does that. It’s called SEO Title Tag.
Cigar Inspector
April 24, 2008 at 1:13 am
Thanks for the tip! I appreciate it.
matthelmke
April 24, 2008 at 4:02 am
I blogged about a method to do this on all pages with a title and display the blog name then the tagline on the home page, here http://www.unintentionallyblank.co.uk/2007/05/01/semantic-header-markup-means-search-engines-will-understand-too/
Phil Nash
April 24, 2008 at 4:31 am
I use the all-in-one SEO plug in – I must admit that I’ve not looked into it too much to be honest, but I think I’ll optimise my titles at some point today, as they are one of the most important elements of SEO.
Thanks for the tips
Carly
April 24, 2008 at 4:33 am
Carly, your right, titles are currently, and have always been, the most important tag,,, and I also use the same plugin. I have always taken out the name of the site and included the appropriate key words as needed. The title is the first thing viewers see in the search engines so I made that line as appealing as possible.
Jack Kennard
April 24, 2008 at 6:10 am
Thank you very much for this tip. I changed header.php right away
Daniel Condurachi
April 24, 2008 at 8:02 am
RE: Jack -
I changed all my titles to post/page name | sitename | myname – as I already try and make the titles of the posts I want people to find Keyword rich, and I want my own name to feature higher in the SERPs.
I shall have to wait and see if this works in the way I hope!
Carly
April 24, 2008 at 8:26 am
Yah have been using Optimal Title plugin for all my blogs for a long time, glad to see it’s easier to do it natively in WP2.5.
ShaolinTiger
April 24, 2008 at 10:27 am
And while you’re at it, you could also simply replace
with your own blog name. It will reduce the amount of queries to the database by one for every pageview.Lodewijk
April 24, 2008 at 10:49 am
Personally I use ‘%post_title% presented by %blog_title%’ or ‘%post_title% on %blog_title%’ via the All In One SEO plugin for WordPress.
This makes the title element a sentence that is easier to read and probably scores lots of points for accessibility. I read somewhere that page readers (for the blind) read the separators that so many of use have used in our title tags.
For example this page’s title would be read out, “wordpress tip colon reorder your title tag left-pointing double angle quotation mark mark on wordpress.” How annoying is that?
@Lodewijk : Top tip – I like that.
yahoogle
April 24, 2008 at 11:57 am
I have changed the header.php file according to this tip and then realized that nothing has changed because I am already using the All in One SEO plugin.
;-(
Chess Teaching
April 24, 2008 at 12:16 pm
wow…thank’s …
it’s good for SEO.
Alex L. Setiawan
April 24, 2008 at 6:57 pm
[...] webpages. Of course much of this discussion is about Search Engine Optimization (SEO). Having read Mark Jaquith’s WordPress tip on the subject I thought that I would add my own tip via the [...]
Semantic Page Titles Improve Search Engine Optimization on Blog24
April 25, 2008 at 3:16 am
wow… good tips;
my tip is …
–
what about this tip?
sorry for my english…
가우리
April 25, 2008 at 9:50 am
Nice tip. Thanks!
Adam Presley
April 25, 2008 at 2:35 pm
[...] on WordPress mit dem Hinweis auf andere Anordnung der Template Tags Artikel #644, 27. April 2008 · Tipps, WordPress · 0 Kommentare Tags: SEO, [...]
WordPress 2.5 und der neue Title Template Tag - bueltge.de [by:ltge.de]
April 27, 2008 at 6:19 am
maybe a little bit problem with ” » ” and ” : ” while I need to save the html post
dani
April 29, 2008 at 9:22 am
Did Matt Cutts say anything about the double arrows? Ages ago, there were issues with handling these in search indexes, but that seems to be resolved. Many visually impaired users complain about these and say they do not meet web standards. Personally, I’d love to see them gone and replaced with the traditional dash, so I’m never keen on recommending their use. I like things simple.
Thanks for the info on the new parameters on the tag!
Lorelle VanFossen
April 29, 2008 at 8:19 pm
Thanks for the tip.
paulgray
May 4, 2008 at 7:09 am
[...] to Mark Jaquith, a WordPress lead developer, the default handling of title tags in WordPress is not optimal. And, [...]
How to optimize your title tags — WP Project
May 18, 2008 at 8:23 am
Hi!
Can you give me tip how to create some block on sidebar only root page execept all others?
Thanks!
Odessky
May 21, 2008 at 9:55 pm
Hm, there IS a plugin that does that. It’s called SEO Title Tag
toplist
May 31, 2008 at 3:40 pm
[...] First — The default WordPress theme shows the name of the blog before the title of the post. Reordering your title tag puts the text more relevant to the searcher’s query (the post title) first, encouraging [...]
Don’t Let Google Truncate Your Blog Post Titles!
June 2, 2008 at 9:01 am
I have removed the blog/website name from my title as I think the fact that all pages have it is not ideal.
What do you think? Is this a good idea?
cheers
Tony
Tony Kenobi
June 6, 2008 at 4:53 pm
Cheers mate – I’ve managed to fix my title tags now (had no idea what I was doing TBH) but it’s now worked
mercury thread
June 13, 2008 at 5:35 am
Thanks for the tip.
isterimki
August 9, 2008 at 8:38 am
Excellent tip, Mark. Thanks!
Eric
September 11, 2008 at 5:17 pm
For businnes blog i created | s
in single.php
Maybe, it is help for seo
cerita
September 22, 2008 at 2:31 pm
[...] Mark on WordPress with Tip to reorder your title tag [...]
The Perfect Title Tag - WP Engineer
October 17, 2008 at 9:27 am
mükemmel
ligtv online
November 5, 2008 at 11:53 am
[...] Gracias [...]
Reordena tu Etiqueta de Título | Ayuda WordPress
December 14, 2008 at 4:18 am
[...] WordPress Tip Reorder your Title Tag « Mark on WordPress [...]
WordPress title help
December 24, 2008 at 7:25 am
I wanted to ask: what is the difference between yours:
And this one I found on another site:
|
redsoxmaniac
March 15, 2009 at 9:57 am