We use h1 tags to mark up a heading on a page.
Fair enough, but what about multiple h1 tags per page? Is it harmful to SEO? What rule or good practice do we need to apply?
The answer might not be so obvious, as many developers keep asking that question.
According to Google, it's harmless and even quite common to have multiple h1 for different parts of the page no matter what the doctype is.
So their answer is unambiguous. However, the problem is not the technique but its usage. In other words, the question should be more like "when to use" or "how to use" multiple h1.
In addition to the search engine optimization, there's a big a11y (accessibility) concern with headings.
Headings (h1, h2, h3, h4, etc) bring some context to your webpage. They are useful to create a precise outline for your page.
A typical pattern is to use h1 for the main headline (can be a logo too), h2 for essential sections, and h3 for subparts.
There are best practices for that purpose. The most critical recommendation is to no skip any level, so don't put h4 after h1 if there's no h2 and h3 before. Otherwise, you would break the document outline.
You'd be surprised how often people use heading tags to style their page instead of using custom classes. While it's visually palatable most of the time, it leads to poor semantic.
Screen reader and assistive technology heavily rely on your headings to navigate, but I would say it's critical for everybody. Even if I don't use any screen reader, a well-structured outline allows users to better understanding the logic, especially for a technical article.
Another widely spread SEO pattern is to use the primary keyword, the one you specifically target with your page, in your h1.
Most SEO specialists say it's a critical ranking signal for bots when they look at the page's content. Using only one h1 per page would be great to control that signal better and prevent any confusion.
On the one hand, you have Google declaring it's totally fine to use multiple h1 per page. On the other hand, many experts say the contrary.
Well, headings communicate the organization of the content on the page:
I prefer this pattern to write content. I use one h1 per page and multiple h2 tags. If sections with h2 tags are too long, I split them with h3, and so on.
It's not the most sophisticated strategy, but it's convenient, and I guess it's sufficient for SEO bots. I also avoid stuffing keywords in h2 tags as it would be confusing for users.
Google does not say use or don't use multiple h1. They declare they have to adapt to a massive range of websites, with or without proper semantic markup, so if they find multiple h1, that's not a big deal.
The most important thing you have to keep in mind is you can do whatever you like, but only if that makes sense for your users and as long as you don't break the hierarchy.
That's a UX/a11y consideration. From the SEO perspective, there's absolutely no rule, as long as bots understand your section's purpose.
However, having multiple h1 on the same page neither guarantees nor improves your ranking position. Google explicitly recommends not using headings as SEO leverage but more as a context provider.
I've run multiple tests on professional and personal projects. I've never received any penalty when using multiple h1 on web pages.
I prefer using the "natural heading hierarchy" as described by w3.org, but, again, that's from a UX/a11y perspective.
Don't get me wrong. It's an essential perspective, but my point is that it's not for SEO.
In a nutshell, while multiple h1 is not harmful to SEO, there are only a few cases where it makes sense from a user's perspective.