How To Optimize The Title Of Your WordPress Blog
In one my previous articles I was telling you that you should not bother too much with SEO for WordPress, because if your blog will be a success, it will not happen thanks to Google, but thanks to social websites, thanks to your social skills, word of mouth and thanks to how interesting your posts really are.
However, you should not ignore to optimize your WordPress theme under any circumstances.
For this post I consider you have a basic understanding and knowledge of SEO, so you know a few HTML tags and a basic understanding of PHP. If not, feel free to ask me, I will be happy to help. Also, copy/paste abilities help a lot!
So, here it is, a short tip on how to optimize the title of your WordPress blog!
I start by telling you that one of the most important ON PAGE optimization factors is the H1 tag, the title of rank 1.
By default, what would I call THE MAIN TITLE of your blog, the one that you set in in the settings of your blog is H1 everywhere, so if the name of your blog is Custom WordPress themes(as you set it in the Settings page on your blog), this will be set as H1 everywhere, no matter you are looking at the first page of your blog or you are looking at one of the post, in detail or at a page. This way you will have the same H1 everywhere. This is not good since it will be seen as duplicated title. It should be different on every page.
What you should do is change it so when you read a post in details, the title of the post to be H1 and not the main title of the blog. For my blogs I usually do this and I only let the main title of the blog as H1 in the index page.
This could be done easily, requires a minimum understanding of PHP and HTML.
The part that you need to change is inside the header file of your theme. Look for the header.php file in your theme folder and inside it look for <?php bloginfo(’name’); ?>. Just search for it.
That’s the very name of the blog and it is enclosed in H1 tags. It gets displayed every time a page of your blog is open and it is the most important tag on that page. You wouldn’t want it to be the same everywhere, would you?
So what you should do is display it as H1 only when it appears in the home page. WordPress helps you with that info so you don’t need to look for it very much, there is a function called is_home() which tests to see if the page is the index page or not.
So you should look for a code similar to this one:
<h1><a href=”<?php echo get_option(’home’); ?>/”><?php bloginfo(’name’); ?></a></h1>
You can change it to look like this:
<?php
if(is_home())
{
?>
<h1><a href=”<?php echo get_option(’home’);?>/”><?php bloginfo(’name’); ?></a></h1>
<?php
}
else
{
?>
<a href=”<?php echo get_option(’home’); ?>/”><?php bloginfo(’name’); ?></a>
<?php
}
?>
Notice how in the first case, the name of the blog was enclosed between H1 tags, while in the second case there is no H1 tags.
All you need to do is enclose the title of the post between H1 tags in the single.php page.
So, go to single.php, look for something similar to <a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a> and enclose it between H1, so it would look like this:
<h1><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></a></h1>
That’s about it!
Was it hard?
PS: After changing this, probably there will be a change in the way the title of your blog will look so you would need to have a CSS class to make the title of your blog, without the H1, look like it would have H1 around it so the site look consistent everywhere. I will explain about it soon.
Bookmark It
Hide Sites







A few days ago I have been asked if one should use a CMS such as WordPress to build a site or to develop the site from scratch on a custom platform.
