Format Headline Title Tag To Attract Readers
Blog World has an article about attracting readers with your headline. One of the suggestions the author makes is in the way the <title> is used.
Take a look at the page titles on this site. Notice that the headline of the post comes before the name of the site. Thats deliberate. I added a WordPress plugin specifically to do that. Why? Because readers really donâ€™t care what the name of the site is. They want to know what the post is about. The same is true for people who come across this page in a search engine.
That makes sense to me so I created a <title> tag that shows the name of the site and then the site description when on the home page, but when on a single article page, display the article title, then the site name. The author of this article used a plugin to accomplish this but all that is needed is some simple PHP
and a slight hack.
First I created the <title> tag like so
Note: WordPress adds a space between < and ?php so be sure to eliminate that space when copying the above into your header.php or index.php.
This puts the name of the blog and then the description in the title tag when the visitor is on the home page. When a visitor goes to a single page the title of the article is first followed by the name of the blog.
The only caveat I found is WordPress by default adds some formatting to the bloginfo(‘name’); tag which really should be left to the user to format so I went into templates-functions-general.php and on line 130 I changed
$sep = ‘»’, to $sep = ‘ ‘,
The above hack is not needed as Andy Skelton pointed out in the comments. I changed the <title> code below to reflect the change.
Now I have a <title> tag as the author suggests. I tried to follow the authors other suggestions in creating the headline for this article.
Update: I forgot about page.php and other template pages when creating the above title code. Here is the updated code