Blog SEO Tips - SEO Friendly Titles (H1, H2, H3)

Another quiet Sunday in the blogosphere, as usual. This morning I thought about writing another link share post or a WordPress theme recommendation, but later I’ve decided to break the pattern (since it’s all so quiet) and make Sundays the host of a blog SEO tips series. In this first post I’m going to talk about the importance of using SEO friendly titles (H1, H2, H3) and the right way to do so.

Usual Coding Patterns in WordPress Themes

If you’re even a bit familiar with the WordPress themes, by now you’ve probably took a look at your theme’s files. Blog pages are rendered through an association of a few PHP files with standard names (index.php, archive.php, single.php) with different templates of the theme, based on the content type.

The index.php file usually stands for your home page, also being capable of replacing any other template that hasn’t been already defined. So, if you don’t have a template for search results (search.php), the index file will take over and render your search results page.

Each of these templates includes smaller pieces of code to build up the final result. The most used are header.php, sidebar.php and footer.php.

For now, we’ll limit our attention to the following files in your theme’s folder:

  • header.php
  • index.php
  • single.php
  • page.php (not every theme has it)
  • archive.php, search.php (not every theme has them)

Optimizing the Header File

Having your primary keyword present at the top of you page it’s very important.
Considering the fact that most themes come with text based logos instead of graphics, we’ll be looking for the <h1> tag in the header.php file.

If you look at the WordPress default theme will find this piece of code, close to the end of the file:

<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div class="description"><?php bloginfo('description'); ?></div>

The first line displays your blog’s title into a link to the homepage, inside the H1 tag.
The second line displays your blog’s description.

H1 is the most important heading style and the coding recommendations state that only one should be used per page. When talking about a homepage, archive page or search results, it’s best that we optimize these pages according to our main keywords, therefore this H1 tag is required.

But what about on the single post pages? When we display single post, we would want to have their pages optimized according to their content, not the overall keywords of the blog. This is where the H1 should be removed from the header.php file, and placed instead of the H2 surrounding the posts title, to give make it more visible and representative in the eyes of a search engine spider.

How do we do that? First we need to add some conditional tags in the header.
Look for the piece of code that I’ve listed above and replace it with this one:

<?php if(is_single() OR is_page()) {
// On single post pages and static pages we use this code
?>
<h2><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div class="description"><?php bloginfo('description'); ?></div>
<?php }
else {
// On home page and archive style pages we use this code
?>
<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div class="description"><?php bloginfo('description'); ?></div>
<?php } ?>

By using some WordPress conditional tags we managed to limit the use of the H1 HTML tag to all archive style pages (including the homepage).

Next, we move to single posts and static pages to continue our optimization.

Optimizing the Single Posts and Static Pages

After we’ve made the changes in the header file, we need to apply some modifications to the single.php and page.php files to make their titles more search engine friendly.

Open the default theme’s single.php file and look for this piece of code:

<h2><a href="<?php echo get_permalink() ?>" rel="bookmark"
title="Permanent Link: <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

Remember that I’ve told you we are allowed to used <h1> only once per file, for our most important title / phrase. Since we’ve eliminated the use of <h1> on single posts and static pages in the header.php, now, all we have to do is to change <h2> and </h2> with <h1> and </h1>, just like this:

<h1><a href="<?php echo get_permalink() ?>" rel="bookmark"
title="Permanent Link: <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>

There you go, now your most important phrase on a single post page is the post’s title, as it should be!
Most themes don’t come with this type of heading importance separation and by following this guide you’ll be able to fix this issue on your own with no trouble at all.

While the default theme does not have a page.php template defined, you could clone the single.php file and rename it. If you don’t clone it, the index.php file will be used to display static pages, which means you’ll list page titles using the <h2> instead of <h1>.

Consider Using Subheadings in Your Posts

For further SEO improvement, you should consider using relevant subheadings inside your post to evidentiate different parts of your post’s structure.
Write down your article and when you’re finished, switch to HTML view and add <h3> & </h3> around you subheadings, like this:

<h3>This Is a Subheading</h3>

Final Thoughts

Usually, titles are the most important links on your blog. Through them, users and spiders alike navigate through your content. Use them smart and effectively.
If you have any questions or need further help with this, feel free to drop a comment.
Also, join me again next Sunday for a new post in the Blog Seo Tips series.

More Blogsessive Content

This article has 19 comments

  • Not a bad post. Every person that knows a bit of SEO should know this, and if he doesn’t he came to the right place to read about it.

    And talking about optimizing single posts. How about you start with removing the links to the post on your single posts, so you’re not pointing to the same url. It has negative SEO effects.

    Try and do a bit of research on it.

  • Thanks MrCooker. I’ll look into your suggestion. It sounds possible and probable.

  • Thanks!!
    Really nice blog

  • Very good tips for a beginner in SEO, it will definitely increase the traffic a little.

  • i removed the (self) link from the post title a few months ago on a blog of mine and the results started to show off just a few days later.

    it boosted the SE rankings :)

  • After doing a bit of research I’ve decided to do the same. Thank you post for the suggestion. Now, we wait and see for the effects.

  • Thanks for tips around H tags
    I’m newbie in SEO, so every hint is good.

  • But again…who needs traffic…its more about “Targeted Traffic”.

  • Different websites value different types of traffic. Niche blogs look indeed for more targeted traffic, and having your titles boosted up by the right tags will only help your blog reach more search engine users for more relevant keywords. This is targeted.

  • SEO Pune, don’t be stupid! Search Engines send you the most targeted traffic.

  • Great tips. Thanks!!

  • That is one extended tips. Pretty open and great for SEO learners.

    I was just wondering if putting nofollow tags has got to do anything with traffic? Because I heard putting nofollow could narrow down the flow of traffic to a blog or any websites.

    Thanks again in advance.
    Chris

  • @Chris: Some people say “nofollow” links can help building traffic. I guess is all comes down to each one’s personal way of implementing them.

    I can recommend you 2 great articles that will bring more light about “nofollow” links:
    Nofollow in Google, Yahoo and MSN
    Sculpting with Nofollow Works Pretty Darn Well

    Personally, I like the idea of sculpting spiders’ way into your content through “nofollow” links, like SEOmoz explains and proves.

    Hope this helps.

  • [...] The best thing you can do to improve you search engine rankings is add some keywords and use SEO friendly titles. Of course, the majority of company websites will need to have the company logo in the header. So [...]

  • Optimizing Titles with header titles also help boost your rankings. Thanks for the tip..

    Just SEO It
    Admin

  • nice very informative.

  • hey, good stuff here, thanks for sharing this. if you have time check out my post on this topic as well. Making Your Blog SEO Friendly I have been talking about some regular update of quality content.

  • [...] Use your main phrase in subtitles and, obviously, in the post title too. Add it to the post’s Meta tags, along with the support keywords. I’ve explained before how you can fine tune your blog to turn your post’s title into a SEO title. [...]

  • [...] different h1 tags for your index and post pages, the article below gives you the code how todo it Blog SEO Tips - SEO Friendly Titles (H1, H2, H3) | Blogging Tips from Blogsessive kind regards, Tom __________________ With Sapphic Cash I make a stunning 0.24 cents per unique [...]

Add a comment

Submit comment!