In this post, we are going to look at the role that header tags – h1, h2, h3, etc that you see placed between two brackets <> – play in SEO and the proper formatting of a blog post or article.
How To Use Header Tags for Search Engine Optimization (SEO)
The easiest way to think about a header tag is – as the name suggests – to think about headings in general. Every piece of content, be it blog, article, or static page, should have headings. These headings are a visual cue to the reader, and a programmatic cue to the search engines, that help define what each section of your content is about.
One example of a heading is the title of an article. Think about this: why do you have a title at all? Its function is simple – to tell the reader what the overall content is about. Typically, a title will be nestled in between the main header tag, which is known as an h1. In code, it looks like: <h1> and </h1>. The first part of the tag is known as the open and the second part is known as the close. Any text that occurs between the open and the close gets formatted as a header tag. So for example:
<h1>This Is an Example of an H1 Header Tag</h1>
Would display the text: “This is an Example of an H1 Header Tag” in a bigger text visually. It would also send a signal to the search engine reading the page to let it know that the text contains within is important and (hopefully) contains the subject and keywords that are important to the article’s subject.
What are Header Tags
Now that we know the function of a header tag – to visually cue the reader and to signal search engines about the subject of a given section in your content – we can discuss the hierarchal nature of the header tag system. Given our description in the first section, it would not make sense to make every header an h1 heading, because h1 headers should only be used for the main subject of an article or blog. Think again about our Title example – you would not have multiple titles in an article. However, you could have sub-titles or sub-headers.
There are six header tags, ranging from h1 through h6. Header tags are hierarchal in nature, meaning that h1 has the most importance and h6 the least.
Because of this hierarchy, you can think of h1 tags as the parent and h2 tags as the children. Or, h1 tags as the main title, and h2 tags as the sub-title.
For instance, let’s say that your article discusses how to walk a dog. In this case, your main header would be:
<h1>How to Walk a Dog</h1>
After this main header, you would introduce your article and its subject (how to walk a dog), then follow it up in the next few sections by discussing the steps to walk your dog. These following steps, therefore, would be sub-headings and use the h2 tag:
<h2>Get Your Leash</h2>
Of course, there are more steps to walking your dog than just getting your leash. So you will need more sub-headings:
<h2>Put the Leash on Your Dog</h2>
<h2>Walk Your Dog</h2>
<h2>Clean Up After Your Dog</h2>
Inbetween each of these headings, you would, naturally, have content – ranging between 2-4 paragraphs, which would relate to its respective heading. This is how the above structure would look when put together:
<h1>How to Walk Your Dog</h1>
Here is where you would introduce your article’s subject in two to four paragraphs. It is the main subject of the article.
<h2>Put the Leash on Your Dog</h2>
Here is the first sub-heading. Here you would write 2-4 paragraphs (ideally) about how to put a leash on your dog.
<h2>Walk Your Dog</h2>
Here is where you would write about the steps involved to actually walk the dog.
<h2>Clean Up After Your Dog</h2>
Here is where you would detail how to clean up after your dog (hopefully you know how to do this!).
<h2>Talk Your Dog Back Insider</h2>
Tell us how to take a dog back inside of your house.
Elements of a Header Tag
From here, things can get a little tricky. Using our parent scenario (h1) and child (h2), think about what would happen if your child had a child – or your sub-heading had a sub-header. This would, in turn, make for an h3.
To visually make sense of this, take a look at the heading, “Clean Up After Your Dog”. In theory, this subject contains several steps. If it warranted a long discussion or a breakdown, could use h3 tags to tell us what each of these sections is about:
<h2>Clean Up After Your Dog</h2>
Discuss what this section is about.
<h3>Take Out Your Plastic Bag</h3>
Information about taking out your plastic bag would go here.
<h3>Pick Up The Poop</h3>
Here you would – in great detail perhaps – discuss how to pick up poop without gagging.
<h3>Throw Poop in the Garbage</h3>
In this part, you would talk about how to dispose of your dog’s poop properly.
Once you finish with your h3 headers, you will want to return back to your h2 header structure in most instances. Let’s take a look at how that would look once all put together:
<h1>How to Walk Your Dog</h1>
Here is where you would introduce your article’s subject in two to four paragraphs. It is the main subject of the article.
<h2>Put the Leash on Your Dog</h2>
Here is the first sub-heading. Here you would write 2-4 paragraphs (ideally) about how to put a leash on your dog.
<h2>Walk Your Dog</h2>
Here is where you would write about the steps involved to actually walk the dog.
<h2>Clean Up After Your Dog</h2>
Discuss what this section is about.
<h3>Take Out Your Plastic Bag</h3>
Information about taking out your plastic bag would go here.
<h3>Pick Up The Poop</h3>
Here you would – in great detail perhaps – discuss how to pick up poop without gagging.
<h3>Throw Poop in the Garbage</h3>
In this part, you would talk about how to dispose of your dog’s poop properly.
<h2>Talk Your Dog Back Insider</h2>
Tell us how to take a dog back inside of your house.
Notice how we go back to h2 in the last section. That is because we are finished with our sub-sub-heading and returning to a regular sub-heading – the main subject of our article has not changed.
Note, it is possible to introduce an entirely new subject in an article and use more than one h1. If you change the main subject of your article and start a new one, you should always start a new h1 header and sub-header structure.
How To Structure Headers for Proper SEO
Now for the technical side of headers. To create a good header, in addition to the tags and hierarchy, you also need two other things: keywords and the proper character length. Character length is simple: don’t make it so small that you waste space and don’t make it so long that it becomes cumbersome to read. Marketing guru Neil Patel suggests 20-70 characters for proper header length, which should work fine.
While there is a debate on whether keywords in the header tags are truly a ranking factor, I always stick to the adage of better safe than sorry – add them. If the primary subject of my article is “how to walk a dog”, then I want to make sure I use variations of my keyword(s) in headings and sub-headings. In this instance, key phrases like “Dog Walking”, “Dog Walker”, or “Dog Walking Service”. Always make sure your titles are human readable and not just a place to store your keywords; if the header doesn’t make sense when you read it out loud, then don’t use it.
Ask one of our local SEO experts if you have questions about how to use header tags in your content?