Apr 26 2008

Maximum SEO with Wordpress h1 header tags

Wordpress has pretty good search engine optimisation performance straight out of the box, particularly if you use a plugin such as the excellent All in One SEO pack (more about that in another blog).

There is one glaring error though, which I see time after time in Wordpress driven sites. It’s an error that gets me scurrying to the PHP editor to tweak some theme scripts on every Wordpress site I’ve worked on.

The error is the incorrect use of the h1 tags, and I’m mystified why this is incorporated into the otherwise excellent Wordpress themes.

H1 tags play a hugely important role in helping a search engine assess a web page for relevance against a search term. Secondary only to the page title tag, the H1 tag plays a vital role in your on page optimisation.

Unfortunately Wordpress themes invariably assign the h1 tag to the blog name or logo image in the page header. If your blog name contains some target keywords then this might be OK, but if it doesn’t then you are optimising your web pages for the name of your blog and not your target keywords.

Not clever.

The problem is then compounded by the titles of the individual blog posts which are invariably assigned an h2 tag. The blog title will almost certainly contain some of your target keywords (and if it doesn’t you are missing a huge SEO opportunity) so it is this which should be assigned a h1 tag.

To fix this problem is actually easy, but it does involve delving into the PHP scripts and CSS file in your theme directory. No you don’t need to be a PHP programming guru to do this, but you do need to know how to edit and save a text file and search for the text “h2″, which I’m sure most people can do!

Are you feeling brave, then here goes…

Actually, the exact steps to maximise SEO with your copy of Wordpress depends on your theme, but we can use a blog that we are optimising as an example. This uses a neat theme that we are modifying to maximise on page optimisation, which it unfortunately needs.

If you look at the source code for the perfectskincare.co.uk home page, you will find this on the home page

<div id="logo">HTML to display the web site logo image</div>

Whereas in the out of the box theme you will find this in the source code:

<h1>Flash News</h1>

Note that we have changed the header.php script in the theme directory to assign it a class called “logo” rather than the assign the logo image as an h1 tag.

We also had to edit the style.css file, which also resides in the theme directory to create a class called logo, which, with basic CSS knowledge is very easy to do.

Now to change the blog post title from an h2 tag in the original theme to a more SEO optimised h1 tag.

View the source code of this page in the modified blog theme. See how the blog post name is assigned an h1 tag and notice that there is only one h1 tag on the whole page. Its doing its part showing the search engines what is an important element to match against the search term.

This is the relevant source code for the blog post title on the modified theme:

<h1>Hand Cream that works</h1>

Whereas this is the source code for the blog post title in the unmodified theme blog post:

<h2 class="singleh2">Testing The Elements</h2>

Note the h2 tags and not an h1 tag in sight other than for the overall blog name.

To change the code to maximise on page optimisation with better assigned h1 tags, is actually easy. You merely edit the single.php script in the theme directory to find the blog post title and change the h2 tag to an h1 tag.

You will also need to create a suitable h1 class in the style.css file. Upload both files to your theme directory on your web server and bingo, you have just improved the search engine performance of your blog, for very little effort.

A quick point. Don’t think we are criticising the Flash News theme mentioned here. We actually rate it very highly and recommended it to our client. We are merely using it to illustrate the problem that we are trying to fix. A problem that unfortunately most Wordpress driven blogs suffer from.

When you are striving for maximum search engine performance from an already excellent software product, you have to spend a few minutes tweaking one or two scripts, and then, before you know it, you too are using power strategies and techniques!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • e-mail
  • Slashdot
  • Reddit
  • Technorati
  • Ma.gnolia
  • Spurl

Tags:
Posted under Wordpress |


3 Responses to “Maximum SEO with Wordpress h1 header tags”

  1. This is an absolutely excellent article. The fact that it does not currently have big page rank or many comments is proof that people do not pay enough attention to the tags.

    I had assumed that with the SEO plugin I had more or less optimized. But, as it turns out, LESS!

    My title tag was good, but the H1 and H2 tags were terrible as my blog covers a variety of themes.

    So, thanks for this great article. I think the SEO plug-in will allow me to modify these tags.

    I will try to employ my new Hx knowledge here: http://www.thisishowyoudoit.com/blog/index.php/2008/06/us-open-golf-2008-torrey-pines-thursday-coverage/ as I write coverage of the US Golf Open.

    But I do have a question. For the title of my post, I use the title tag. What should I put in the H1-H3 tags. Any suggestions?

    Again, this article is great stuff.

    Thanks,
    Richard

    PS: I am going to blog about this and will DEFINITELY link to this informative article!

  2. Hi

    It was great to find this article, I’ve been spending hours and hours trying to find a way to get the post title to be the h1 and not the blog title for my site, but hadn’t managed find a way until I came across you article

    Many thanks

    Bill

    ps
    I’ve just dugg your article :)

  1. 1 Trackback(s)

  2. Meera Tank | Web, Design and Stuff! » Increase SEO with Wordpress H1 Tags

Post a Comment