On-Page SEO

Header Tags

Shahid Maqbool

By Shahid Maqbool
On Jul 4, 2023

Header Tags

What are Header Tags?

Header tags are HTML elements used to define headings and subheadings within a webpage's content.

These tags are hierarchical, ranging from H1 to H6, with H1 being the most important and H6 being the least important. 

They help organize the structure of a webpage, by breaking up the entire information into more manageable sections, making it easier for both users and search engines to understand the content.

Header tags example

Example of header tags in a blog post’s HTML code 

In a blog post's HTML code, header tags are used to create a structured hierarchy of headings and subheadings.

Here is an example of how different header tags (H1, H2, and H3) might be used in a blog post about the SEO’s best practices:

<!DOCTYPE html>

<html>

<head>

<title>10 Essential SEO Best Practices for 2023</title>

</head>

<body>

<header>

<h1>10 Essential SEO Best Practices for 2023</h1>

</header>

<main>

<article>

<header>

<h2>1. Conduct Keyword Research</h2>

</header>

<section>

<header>

<h3>1.1. Use Keyword Research Tools</h3>

</header>

<p>Paragraph about using keyword research tools.</p>

<header>

<h3>1.2. Analyze Search Intent</h3>

</header>

<p>Paragraph about analyzing search intent.</p>

</section>

<header>

<h2>2. Optimize On-Page SEO</h2>

</header>

<section>

<header>

<h3>2.1. Create High-Quality Content</h3>

</header>

<p>Paragraph about creating high-quality content.</p>

<header>

<h3>2.2. Optimize Title Tags and Meta Descriptions</h3>

</header>

<p>Paragraph about optimizing title tags and meta descriptions.</p>

<header>

<h3>2.3. Use Header Tags Strategically</h3>

</header>

<p>Paragraph about using header tags strategically.</p>

</section>

<header>

<h2>3. Improve Website Performance</h2>

</header>

<section>

<header>

<h3>3.1. Optimize Page Load Speed</h3>

</header>

<p>Paragraph about optimizing page load speed.</p>

<header>

<h3>3.2. Implement Responsive Design</h3>

</header>

<p>Paragraph about implementing responsive design.</p>

</section>

<!-- Additional H2 and H3 tags would follow for the remaining best practices -->

</article>

</main>

</body>

</html>

In this example, the H1 tag represents the main heading of the blog post, while the H2 tags are used for subheadings that introduce individual best practices.

H3 tags are then employed to denote subsections within each H2 subheading, providing more detailed information on each topic.

Why are header tags important?

Header tags play a crucial role in search engine optimization, helping search engines understand and index the content of a webpage more effectively. They are considered important in many ways:

Clear hierarchical structure

Header tags help to organize the content into a clear hierarchical structure, allowing search engines to identify the main topic and related subtopics, which can lead to better indexing and higher relevance in search results.

Improved relevance in search results

Using header tags strategically can make a webpage more relevant to search queries by emphasizing the important keywords and topics within the content.

Google assigns greater value to text within header tags, which helps the search engine determine if a page is relevant to a user's query. 

Including the target keyword in the H1 tag and related terms in other headers is a key aspect of optimizing a page for search.

Enhanced user experience

Header tags enhance the user experience by making the content easily scannable and navigable.

This improved readability not only benefits users but also contributes to a better engagement rate, lower bounce rate, and ultimately, better SEO performance.

By structuring content into sections and subsections with appropriate headers, the information becomes more digestible for both human readers and search engine bots.

Historical usage

In the early days of HTML, the <header> element was initially used for headings. As HTML evolved, the <header> tag was replaced by <h1> through <h6> tags, which were introduced to represent different levels of headings and subheadings, providing more structure and hierarchy to web pages.

The <h1> tag is the most important heading, while <h6> is the least important. This change allowed for better organization and improved readability of web content.

As HTML continued to develop, the <header> element was repurposed to serve a different function.

In HTML5, the <header> tag was reintroduced as a semantic element to represent the header section of a web page or a specific section within the content. 

This header section typically includes elements such as the site logo, navigation menus, introductory content, or authorship information.

The usage of the <header> element, along with other semantic elements introduced in HTML5 (like <nav>, <article>, <aside>, and <footer>), contributes to creating a more meaningful and accessible structure for web content, making it easier for search engines and assistive technologies to understand the page's layout and purpose.

H1 vs title

The H1 and title tags serve different purposes in the context of a webpage, but both are important for SEO and user experience.

H1 tag:

  • The H1 tag is the main heading of a webpage, visible to users when they visit the page.

  • It provides an overview of the page's content and helps readers understand the topic at a glance.

  • It is usually the first header tag on a page and is placed within the <body> section of an HTML document.

  • H1 tags can be used for styling purposes, as CSS can be applied to change their appearance.

Title tag:

  • The title tag is an HTML element that defines the title of a webpage, but it is not displayed on the page itself.

  • It appears in search engine results pages (SERPs) and browser tabs, providing users with a brief description of the page's content.

  • The title tag is placed within the <head></head> section of the HTML document and is wrapped in <title></title> tags.

  • Title tags play a crucial role in SEO, as they help search engines understand the page's topic and relevance to user queries.

However, both can be the same if you have not chosen to make them different. Essentially, keeping them different is advisable and looks more logical. 

There are instances when it might be beneficial to differentiate them. For example, you may want a shorter title tag to fit within the character limit for search engine results pages while having a more descriptive H1 for your visitors on the actual webpage.

It's important to strike a balance between optimizing for search engines and providing a good user experience.

As long as the H1 and title tag variations still convey the same core message and remain relevant to your content, it's acceptable for SEO purposes to have them differ.

How many header tags are supported by HTML?

HTML supports six levels of header tags, ranging from H1 to H6. Each level represents a different degree of importance or hierarchy, with H1 being the most important (usually the main title of a page) and H6 being the least important (used for the smallest subheadings or side notes).

To summarize:

  1. H1 - Most important heading (main title)

  2. H2 - Subheadings

  3. H3 - Sub-subheadings

  4. H4 - Additional levels of subheadings

  5. H5 - Further levels of subheadings

  6. H6 - Least important heading (smallest subheadings or side notes)

Are header tags a ranking factor?

We know that well-structured header tags enable search engines to accurately gauge the significance and context of your content, which can lead to higher relevance in search results when users perform a search. 

However, it may lead to improved rankings because of good user experience but is not directly linked to it. As John Mueller clarifies this in a video:

…so these heading tags in HTML help us to understand the structure of the page but it’s not that you have any kind of a fantastic ranking bonus by having text in an h2 tag…. it’s not the case that you would automatically rank one or two spots higher just by using a heading so I’d recommend using it to give a semantic structure to the page but I wouldn’t say that this is a requirement for ranking properly in search.

John Mueller

What’s Google’s take on multiple H1s?

It is perfectly fine to use multiple H1s as Google doesn't have an issue with this practice. However, it's generally recommended to stick to one H1 tag per page for optimal SEO and better content organization.

Matt Cutts clarifies why using too many H1s can make your content look messed up but using it in moderation and in a logical way is fine.

How to add header tags in HTML?

Adding header tags in HTML is simple. You can use the <h1> to <h6> tags to define headings and subheadings in your content.

Here's how to add header tags in HTML:

  1. Open your HTML file in a text editor or an Integrated Development Environment (IDE) like Visual Studio Code, Sublime Text, or Atom.

  2. Locate the section of the content where you want to add the header.

  3. Use the appropriate header tag, depending on the importance or hierarchy of the heading. For example, if you want to add a main heading, use the <h1> tag.

Here's an example of how to add header tags in HTML:

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Adding Header Tags in HTML</title>

</head>

<body>

  <h1>Main Heading (H1)</h1>

  <h2>Subheading (H2)</h2>

  <h3>Sub-subheading (H3)</h3>

  <h4>Additional Subheading (H4)</h4>

  <h5>Further Subheading (H5)</h5>

  <h6>Least Important Subheading (H6)</h6>

</body>

</html>

In this example, the main heading is enclosed within <h1> tags, and subheadings are enclosed within <h2> to <h6> tags, depending on their importance or hierarchy.

Save the HTML file, and when you open it in a web browser, you will see the headings and subheadings displayed with different font sizes and weights, reflecting their importance in the content structure.

Using WordPress

Adding heading tags in WordPress is a straightforward process that can be achieved using two methods: keyboard shortcuts and the drop-down menu within the editor.

For those who prefer using keyboard shortcuts, the process is slightly different depending on whether you're using a Mac or a PC.

On a Mac:

Press CTRL + ALT + 2/3/4/5/6 to apply the corresponding heading tag (for example, <h2>, <h3>, and so on).

On a PC:

Press SHIFT + ALT + 2/3/4/5/6 to apply the appropriate heading tag (such as <h2>, <h3>, etc.).

Alternatively, you can use the drop-down menu available in the WordPress editor to apply heading tags.

First, select the text you want to assign a heading tag to, then click on the drop-down menu (usually labelled "Paragraph" by default) located in the toolbar.

From there, choose the appropriate heading level (H2, H3, H4, H5, or H6) to apply to the selected text.

Using Wix

Adding heading tags in Wix is a user-friendly process that allows you to structure your content effectively. 

To modify heading tags on your Wix website, follow these steps:

  1. Log in to your Wix account and open the website editor.

  2. Navigate to the page where you want to add or edit heading tags.

  3. Click on the text element containing the words or phrases you'd like to modify.

  4. Highlight the text you want to assign a heading tag.

  5. Click on the "Themes" drop-down menu, typically located in the toolbar at the top of the editor.

  6. Choose the appropriate heading level (H1, H2, H3, H4, H5, or H6) from the available options.


If you want to edit header tags within a blog post on Wix, follow these additional steps:

  1. From your Wix dashboard, navigate to your blog section.

  2. Open the specific blog post you'd like to edit.

  3. Locate the header you want to modify within the blog post editor.

  4. Highlight the header text.

  5. Click on the "Paragraph" option, usually found in the toolbar at the top of the editor.

  6. From the drop-down menu, select the appropriate heading level (H1, H2, H3, H4, H5, or H6).

Using Shopify

To add or modify heading tags on Shopify, follow these steps:

  1. Log in to your Shopify admin dashboard.

  2. Navigate to the page, product, or blog post where you'd like to edit the heading tags.

  3. Click on the content editor and highlight the text you want to change.

  4. Click on the "A" button, usually found in the toolbar at the top of the editor.

  5. From the drop-down menu, select the appropriate heading levels (H1, H2, H3, H4, H5, or H6).

For changing heading tags on the homepage or within theme files:

  1. Navigate to the "Online Store" section and click on "Themes."

  2. Locate your active theme and click on the "Actions" button, then select "Edit Code."

  3. Locate the file you need to edit, such as "theme.liquid" or a specific section file (e.g., "header.liquid" or "index.liquid"). Click on the file name to open it in the editor.

  4. Locate the heading tag you want to modify within the code.

  5. Update the heading tag to the desired level (H1, H2, H3, H4, H5, or H6).

  6. Save your changes.

If you're unsure about editing the code or encounter issues with multiple H1 tags, consider reaching out to your theme developer for assistance.

Best practices regarding header tags

Following are the best practices you can opt for to make better use of the header tags.

Add keywords to header tags

Incorporating keywords into your header tags is essential, as Google uses these tags to understand the context of your page.

However, it's crucial to strike a balance between optimizing for search engines and maintaining readability for your users.

While it's important to include target keywords in your header tags, avoid unnaturally forcing them into every heading.

Instead, focus on creating meaningful, informative headings that naturally incorporate relevant keywords where appropriate. This approach maintains a balance between optimization and readability.

If you can naturally integrate keywords into your header tags without compromising the content's flow and meaning, it will benefit both your website visitors and search engine rankings.

Optimize for featured snippets

To optimize header tags for featured snippets, it is essential to create a well-structured and meaningful content layout.

FYI: Featured snippets are brief, informative responses that appear at the top of Google's search results, offering users quick and relevant information.

Start by organizing your content using appropriate header tags (H1 to H6). The primary keyword should be included in the main heading (H1), while subheadings (H2, H3, etc.) should be used to break the content into coherent sections.

Within these sections, develop clear and concise answers to common questions related to the topic.

By maintaining a consistent flow and well-organized structure in your content, search engines can more effectively understand and potentially feature your content as a featured snippet, providing valuable information to users.

Keep headers short and consistent

Maintaining short and consistent headers is essential for enhancing readability and user experience on your web pages.

By keeping your headers within a range of 3-5 words, you ensure that they are easy to scan and understand for both your readers and search engines.

Headers serve as visual markers, breaking up extensive text into organized sections. When headers are too long, they can disrupt the flow and visual appeal of the page, defeating their primary purpose. 

Short and concise headers make it simpler for readers to quickly identify the main topics covered in your content and navigate through them with ease.

Consistency in your header formatting and structure also plays a significant role in improving the user experience.

By maintaining a uniform style and approach to your headers, you create a pattern that allows readers to anticipate and follow the content's structure effortlessly.

Keep the header’s design consistent in CSS

Ensuring consistency in your header design with CSS plays a vital role in establishing a visual hierarchy and enhancing the overall user experience on your website.

HTML provides a default visual hierarchy for headings, with larger and bolder fonts for H1 and H2 tags, and smaller fonts for H3 and H4 tags.

However, some website themes may not adhere to this default hierarchy, causing inconsistencies in the design and potentially confusing users.

To rectify this issue, you can make adjustments within your CSS stylesheet, setting up a consistent header design with appropriate font formatting code.

Alternatively, you can add selectors to a custom CSS field to apply additional styling rules.

What should you avoid?

When working with heading tags, it's crucial to avoid certain practices that can negatively impact user experience and search engine optimization (SEO). 

Here are some things you should avoid when using heading tags:

Keyword stuffing

Overloading your heading tags with keywords can make your content appear spammy and unnatural, ultimately harming your SEO efforts.

Instead, include relevant keywords organically within the headers, focusing on readability and relevance.

Hidden text

Avoid using heading tags to hide text, as this can result in penalties from search engines. Hidden text is considered deceptive and can negatively affect your site's rankings.

Repeating headings

Ensure that each page on your website has unique heading tags, as this helps search engines understand the distinct content on each page.

Avoid using identical content for both your H1 tags and meta title tags to prevent duplication.

Styling purposes

Heading tags should be used for structuring content, not styling text. Use CSS stylesheets for customizing the appearance of your headers and other text elements on your site.

Conclusion

Header tags are essential HTML elements that help structure and organize web content, making it more accessible and digestible for both users and search engines.

To effectively utilize header tags, it's vital to follow best practices. By doing so, you can create a better user experience, increase the likelihood of ranking higher in search engine results, and ultimately drive more traffic to your website.

Related Articles

Leave a reply
All Replies (0)