Customizing Title Tags in Wordpress Without Using a Plug-in - The default Wordpress installation title tag script
(Page 3 of 4 )
When you locate the header.php file, this is the default title tag script:
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
Note that the blog name will come first; which is not advisable for user-friendly title tags. Let’s examine the actual effect of this default script.
At your home page:
If you set your front page or home page to be a static page (recommended for SEO purposes), the actual tag when viewed in HTML source will look something like this:
<title>Blog title » Homepage</title>
The “blog title” is a variable and depends on your choice. This can be edited in Dashboard---Options----General (typically for Wordpress version 2.3.2).
If you cannot locate this, you may be using Wordpress 2.5.1, and this can be edited in Dashboard---Settings---General.
So if your blog title is “Designing Attractive Widgets,” the title tag of the home page when viewed in a browser will be:
Designing Attractive Widgets >> Homepage
This is only beneficial if you set your blog title correctly.
At your post pages:
The default Wordpress title tag script affects so much in the post pages. The Wordpress post is as important as your home page, because posts in blogs contain unique, important and updated content.
Highly similar title tags can prevent your pages from showing up in the search results and your great post will not catch readers’ and search engine attention.
From the default title tag script:
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
In a Wordpress post, there is a new variable called “post title.” This is represented in Wordpress PHP coding as <?php wp_title(); ?>
How does the default script execute? It displays the Blog title first, as indicated by <?php bloginfo('name'); ?> then it will analyze to see if the page is a post or a front page. This is indicated by:
<?php if ( is_single() ) { ?>
If this is not a post, it will directly display something else, such as “Homepage.” If this is a post page, Wordpress will display the text “Blog Archive” after the “Blog title.” This is shown by the following:
» Blog Archive
By the way, » when shown in the browser will display as “>>”
Finally, since this is a post, it will display the post title, as indicated by:
<?php wp_title(); ?>
Let's illustrate this with an example. We'll use the one we used above, but say the post title is “Cheap Widgets 2008.” Then the post title in default Wordpress will be:
Designing Attractive Widgets >> Blog Archive >> Cheap Widgets 2008
Take note that the most important information to convey what the page is all about is shown last.
At your category pages:
Wordpress has categories, a distinctive feature that offers advantages over Google Blogger.
Categories group blog posts according to topics.
To continue with our example, let's look at a category named “All about Widgets.” The category page title when shown in the browser will be:
Designing Attractive Widgets >> All about Widgets
As a summary of the above examples, you can now imagine that if you fail to customize title tags, all of your pages will start with your blog title or name, which is annoying and irrelevant for most of your pages.
Next: Recommended Wordpress Title Tag Script >>
More Blog Help Articles
More By Codex-M