LIBERTAS
EN - SEO GUIDE - HTML Header

What are Header Tags?

HTML header tags are used to differentiate the headings (h1) and sub-headings (h2-h6) of a page from the rest of the content. These tags are also known to webmasters as heading tags or simply header tags.

The most important heading tag is the h1 tag and least important is the h6 tag. In HTML coding, the heading tags from h1 to h6 form a top-down hierarchy. This means that if you skip any of the tag numbers the heading structure will be broken, which is not ideal for on-page SEO.

For example, if your site is introduced with an h1 tag followed by an h3 tag, the hierarchy will be broken, meaning the heading structure is not as SEO-friendly. This doesn't apply, however, to the bottom-up structure, which could jump from an h4 to an h2 without issue.

Ideally, every page should have an h1 tag, but no more than one (unless you’re using HTML5 — more on that below).

HTML Header tags

What are HTML Header Tags in SEO?

We do use H tags to understand the structure of the text on a page better.

  • John Mueller, Google

For SEO, there are 2 main purposes for HTML header tags:

  1. Structuring the page for readability
  2. Relevance to keywords

1. Make the page more readable

Adding sections and subsections, with appropriate headers, divides content into scannable blocks that are much easier to consume. For both humans and bots.

Look at your page’s HTML header tags as a way of creating an outline or sketch of your article, using body content to fill in details and examples.

In fact, you can look at the HTML headers in this article as an example. Here are the headers for this article:

<h1>What are Header Tags?</h1>
<h2>What are HTML Header Tags in SEO?</h2>
<h3>1. Make the page more readable</h3>
<h3>2. Make the page more relevant</h3>
<h2>How to Write HTML Headers for SEO</h2>
<h2>Things You Should Not Be Doing with HTML Headers</h2>

This translates directly to a traditional outline for this article:

  • What are Header Tags?
    • What are HTML Header Tags in SEO?
      • Make the page more readable
      • Make the page more relevant
    • How to Write HTML Headers for SEO

Things You Should Not Be Doing with HTML Headers

2. Make the page more relevant

Google sees the text used within the HTML header tags as more valuable, or a higher priority, than the rest of the text on a page. Therefore, words used in the header tags are weighted more highly when Google is trying to figure out if a page is relevant to a user’s query. In fact, a page’s h1 tag is one of the most important places to use a keyword.

For example, if the keyword you want to target is “on page SEO”, you would use that in your h1 tags, and topically related words in your outline:

  • On page SEO: The Ultimate Guide
    • What is On Page SEO?
    • What are On Page Ranking Factors?
    • Best On Page SEO Techniques
      • Robots.txt
      • XML Sitemap
      • Speed
      • HTML Headers
    • On page keywords
    • Best On Page SEO Tools
    • Bonus: Off Page SEO

Use a keyword research tool that includes LSI keywords to help you craft your pages’ HTML headers.

This isn’t a case for keyword stuffing. Thanks to the semantic web and LSI keywords, it’s better to use related words that reinforce the relevance, quality and depth of a piece of content to a user’s query.

How to Write HTML Headers for SEO

The way you write your headers and subheads depends on which HTML header tag you’re talking about.

  • Put the h1 tags at the top of your page (of course).
  • Use the words people would use when searching for what your content is about.
  • If you’re targeting a question, put the question in the h1 tag.
  • If you’re writing a how-to guide, put each step in an h2 tag.
  • For non-how-to articles, use LSI keywords and other, semantically-related words in your h2-h6 tags. This helps reinforce topical relevance and removes ambiguity.

Those third and fourth points are very important when trying to claim one of Google’s featured snippets for your site. Featured snippets rely on Google’s ability to determine what page best answers a question. Structuring your content to make it more readable is a big part of that.

Find opportunities to claim featured snippets for your site here.

A note about HTML5: Pages using HTML5 can use h1 tags as section headers for content, which means they can have one h1 tag per section. A page can have multiple h1 tags using HTML5 like this:

<div>
<header><h1>How to Do On Page SEO</h1>
</header>
<article>
<h1>On Page Content</h1>
<h2>HTML Headers</h2>
<p>Body text<p>
</article>
<article>
<h1>Technical SEO</h1>
<h2>Meta Tags</h2>
<p>Body text<p>
</article>
</div>

Things you should not be doing with heading tags

  • Do not stuff your heading tags with keywords.

  • Do not use more than one h1 tag on a page. Usually, pages will have a single h1 heading and including two might make search engines think this as an attempt to include more keywords for SEO in multiple h1 tags. It is better to divide the content into two separate topics on individual pages with their own h1 tags. This makes more sense to both readers and the search engine spiders, however, using multiple h1 tags is allowed.

  • Do not use heading tags as hidden text. Any hidden text can result in penalties for your site, especially if the hidden part is a component that affects SEO.

  • Do not repeat heading tags on different pages of your site. It is a good practice to have unique heading tags throughout your site. Avoid using identical content for both your page’s h1 tag and meta title tag.

  • Do not use heading tags for styling text but use them for presenting organized and structured content on pages. Use CSS stylesheets for the purpose of styling.

A note about HTML5: Pages using HTML5 can use h1 tags as section headers for content, which means they can have one h1 tag per section. A page can have multiple h1 tags using HTML5 like this:

<div>
<header><h1>How to Do On Page SEO</h1>
</header>
<article>
<h1>On Page Content</h1>
<h2>HTML Headers</h2>
<p>Body text<p>
</article>
<article>
<h1>Technical SEO</h1>
<h2>Meta Tags</h2>
<p>Body text<p>
</article>
</div>

Recent guides