I am aware that Google uses text inside of h1 tags to help index webpages and this can improve a website's SEO ranking.

Does nesting SEO-important text such as a page title inside of multiple html elements which have a h1 as a parent adversely impact this? Or is it treated the same by Google as if the text were written directly inside of the h1 tag?

(I understand this is not best practice and should be avoided anyway. But I am interested to know what the effect of doing it would be).

2 Answers 2


Since you already know that unnecessary and bad nesting is not recommended, the answer to your question is given below.

  • Yes, they're same. No matter how many elements you used within h1 to further wrap your content within h1, only the text is extracted from it for the intended use.
  • Nesting is not bad all the times. For example:
    • using strong element within h1
    • using span to stylize a part of h1

Additional tips that may help you: -

Bad h1 includes: -

  • using media elements (img, video, object, embed, etc.) within h1
  • multiple h1 on the same page with similar content or context


Just by having a good h1 doesn't directly improve ranking, however, it does improve the discoverability of your content which may lead to improved rankings depending upon other factors. It just helps Google to easily find the main topic of the page by extracting the text and getting the context. If the context evaluates to something else or unclear, Google won't prefer to show it to the searcher (user).


To add to what Aqsa J. said above, while you could technically wrap elements like divs with an h1 without any penalty, there will almost never be a case where it'll make sense to do so, particularly given that both h1 and div are block level elements and behave similarly in the page's flow.

A div is a block level container that has no properties of its own, and is used to style the page and the content inside it. So whatever properties you might add to the div, you can add to the h1, or to the nth h1 on the page.

Now, it might make sense to put your h1 inside a div, especially if that h1 is grouped with other elements and you want them to have a set of shared properties as a unit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.