H1 or H2? How to Handle Headers?

In (X)HTML, there are several levels of headings. You have h1, h2, h3, h4, and so on. The proper way to use them is in a structural manner, a post title having a lower number (e.g. h1) than subheaders in a posts content, which would be the next one down (and then subheadings below that would be h3).

Search engines are very big on the h-tags, treating content in h1s and h2s as more important than most other text.

The question is, where should that structure start? Information on the semantics of heading tags is very mixed, and can be hard to sort through.

Some say that a blog’s post titles should be h1s, while others say that a blog’s name should be an h1 (though that assumes that you’re using plain text instead of a logo). Some say that there should only be one h1 tag on a page, which I think is a safe practice SEO-wise. (Google has been known to frown upon sites that make excessive use of h1s, considering the emphasis the search giant places upon them.)

Here’s the best way to handle headings on blogs:

On the index and archive pages, h2 tags should be used for post titles. On permalink pages, use h1 instead. You can then use h2s, h3s, etc in your post content, for subheadings. I suppose an h2 would work for the “x Comments” and “Leave a Comment” messages as well.

I’m not sure about sidebar headers though. They would best be h3s, or possibly just stylized bold tags…

Well, those are my suggestions, for the average blog, feel free to deviate from them as you see fit. At any rate, don’t let the size of the elements have any role in your decisions. Use CSS to make them the sizes you want.

EDIT: Devlounge has posted a response to this post with some good discussion going on.

  • http://www.mealybar.co.uk/ Richard

    I’ve always put the site name in a h1, the page title h2, and then article sections in h3. Even when using a logo and not a site name I use the h1 and display: none. Not sure if its right, but it makes sense to me when I turn CSS off.

  • http://stevenclark.com.au Steven Clark

    I’m actually very similar to Richard. First, regardless that by the spec you can use more than 1 h1 element it strikes me (as a computer guy) as a strange information hierarchy to have 2 top level headings. That implies two pages. So I’m definately a single h1 guy. I would say that site name versus page name in h1 is probably a personal choice thing – my blog is using site name at present but the next design iteration may not. Both arguments have pros and cons on that one – and I think Google can get the information as long as you have good content and meaningful headers / structure so it’s probably not as important what level heading as much as it is important to have meaningful heading structure / hierarchy and supporting content. The tags themselves just explain hierarchy and what follows them. I tend to use h2 level headings in the sidebar or when I write content for new logical div sections of the page… if that makes sense. Just my 2 cents.

  • http://www.webmaster-source.com Matt

    I think it is mainly up to personal preference, so long as you do it consistently, and don’t try to spam search engines by making as many things as possible h1s.

  • Pingback: Handling Headers: Where to Use h1 and h2 | Devlounge

  • http://akamike.net/ Mike Robinson

    From what I understand, SE’s will actually penalise you for using multiple H1’s (whether maliciously or not). This caused many SEO people to place everything in H2’s, which didn’t seem to have the negative effect. But, of course, this skipped the h1 and invalidated things.I didn’t read your post first time round when checking out the Devlounge one, but now I did I am glad to see I am not the only one who ponders what to do with supplementary (sidebar) content. Suffice to say, headings are greatly flawed… :(

  • http://www.webmaster-source.com Matt

    @Mike, There is a brief note about search engine penalties for multiple h1s in the article, though perhaps a little too brief. In retrospect I wonder if I should have put a little more emphasis on that statement. It’s something that people need to be aware of.

    I wrote this post partly because I’m needing to optimize my current heading structure, it’s a little flawed. Currently I don’t have any h1s at all, and post titles are all h2s on every page. It will be a pain to update posts when I make the change…

  • http://www.gossip123.com Haruyoshi

    In my opinion, never mind h1 or h2, each once is enough.