Jump to content
KUHM

Optimising the h1 to h6 Heading Tags

Posted on - Updated

Optimising the h1 to h6 Heading Tags

A page's internal structure is one of its most important optimisations: the h1 to h6 heading tags draw the outline followed by readers, assistive technologies and search engines alike.

It should therefore not be neglected, and a few simple rules are enough for your headings to truly serve your rankings as well as your visitors' reading.

Purpose and general information on heading tags

Headings serve to introduce the content that follows them. On the one hand for visitors, who often skim a page before reading it, and on the other for search engines, which use them to understand what each section is about.

Each tag is coded like this, with an opening and a closing tag: <hn>Text</hn> (where you replace “n” with the number you want).

A single H1

First of all, keep a single H1 per page. Don't put two or even three H1s (or more) on the same page.

The HTML 5 standard tolerates several H1s as long as they are not nested, but Mozilla's reference documentation (MDN) considers it bad practice: a page should generally have a single H1, which describes its content the way the title tag does. So I stay loyal to the single H1.

Title tag and H1: two different roles

The two are often confused. The <title> tag appears in the browser tab and is the basis of the blue headline in Google's results; the H1 is the large heading visible in the page. They should say the same thing without necessarily being identical: the title can be shorter and carry the site's brand, while the H1 can be more natural and more engaging for someone who has already arrived on the page.

From H1 to H6, and no further!

Hn tags only go up to 6. There is no H7, H8, H9 or the like … Yet you still come across sites with this kind of abomination.

You can stop whenever you like

If your content doesn't call for it, you don't have to use every tag from h1 to h6. You can stop at h3, at h2 or even at h1 (although I advise going at least as far as h2 once the text runs past a few paragraphs).

Decreasing importance

The higher the number, the more the heading is a sub-level of the previous one: the H1 announces the topic of the page, the H2s its main sections, the H3s the detail of each section.

The H1 will therefore play a far more structuring role than an H6, which is rarely useful in a blog post.

Position in the source code

Place the h1 at the top of the main content, just before the text it introduces, and not in the middle of a menu or a sidebar. Headings in the navigation, footer or widgets don't have to be H2s or H3s: a simple paragraph or list tag, styled with CSS, is enough.

A consistent structure

Stay logical: each parent element must represent its sub-elements.

Don't skip steps on the way down. Don't go, for example, from H1 straight to H4: you need to go through an H1, an H2, an H3… However, when a subsection ends, you can go straight back up from an H4 to an H2 to open the next section.

  • An h1 can contain h2, h3, h4, h5, h6
  • An h2 can contain h3, h4, h5, h6
  • An h3 can contain h4, h5, h6
  • An h4 can contain h5, h6
  • An h5 can contain h6

Headings, the first landmark for screen readers

A blind or visually impaired person very often navigates from heading to heading with their screen reader, just as you skim a page with your eyes. A missing level makes them think a section has disappeared, and text that is simply enlarged in bold does not appear to them as a heading at all. A clean hierarchy is therefore first of all a matter of accessibility, and what helps these visitors also helps robots break down your content.

Never choose a level for its size

A classic mistake: picking an H4 because it "looks better" visually than an H2. Text size is set in CSS, with the font-size property, never by changing tags. The heading level says where the section sits in the outline, and the stylesheet decides how it looks.

Simple, explicit headings

If you read me often, you know I always advise not to over-optimise your pages.

Make sure your tags are useful to the visitor and that they structure your page properly. A good subheading announces what the paragraph will deliver: “How long should you keep a quote?” says more than “Information”.

Even though it was very common at one time, it is very unpleasant for a user to come across a heading with an over-optimised wording. Aim for the happy medium, not for piles of keywords.

Along the same lines, avoid irrelevant H1s that give no information, such as “Welcome” or just the site name.

Checking your pages' outline in two minutes

To check a page, display its source code or use a browser extension that lists the headings: you should read a coherent table of contents, with a single H1 and levels that follow one another without gaps. While you're at it, review the rest of the page: the alt text of your visuals, which I cover in the method for optimising images for your Google rankings, and page weight, because a good outline is useless if the visitor leaves before the page displays: see how to optimise the loading speed of a WordPress site.

About the author

Cyril KUHM

Cyril KUHM

Head of MKH, a web agency near Strasbourg, and SEO consultant since 2007. On this blog I share free, hands-on advice to help your site rank better on Google.

Get in touch

Related posts

↑