I'm working on my brand new website and I'm trying to make it as optimized as possible mainly for SEO. In order to reach that goal, I'm trying to do best practices for it's hierarchy.

My website is hierarchy is as the following:

        <!-- ... -->
        <div id="wrapper">
            <div id="menu">
                    <!-- ... -->
            <div id="content">
                <div id="content-wrapper">
                    <div id="main">
                        <header role="banner"></header>
                        <main role="main">
                                    <h1>Article Title</h1>
                                    <p>Article Description</p>
                                        Text comes here..
                            <section id="global-contact-form">
                                    <!-- ... -->
        <div id="contact-button">
            <!-- This is a fixed block -->

My question is: Is it correct to wrap the <header>, <main> and <footer> into divs, as shown on the code above?

  • As long as it is valid HTML then it is correct but why do those elements need those div elements? Are you sure? Too often people insert them for no good reason. – Rob Sep 21 '20 at 11:44
  • I should've asked my question differently: Is it a good practice for the page hierarchy? I mean, mainly for search engines.. – TamirNahum Sep 21 '20 at 14:25
  • You better leave it to the SEO team they will do it all to you, i have similar situation here with my new site been private for years and now i want to publish my site and make it visible on google search and upgrade the design, my friend told me that it’s not enough only to make it public to be visible on google and i need a SEO promotion, as i know SEO promotion is not that cheap and i actually i don’t really want to pay much for it, i searched online for SEO promotion companies and checked prices and actually it’s out of my budget, the most affordable one, i managed with them and discussed – alexmqwn Sep 23 '20 at 22:25
  • It can't be too sure that having an semantically HTML5 correct website will move you up in the rankings, or create better exposure from public searches. But it is safe to acknowledge that the more semantical detail you provide to search engine then the better search engines will be able to understand and index your content. Using HTML5 elements surely can’t hurt. Google Doesn't care about structure. – AjayGohil Sep 24 '20 at 4:59

It's perfectly acceptable to wrap these elements in divs, as far as SEO.

As far as best practices, it's also fine to use divs like this as long as those divs serve a structural or stylistic purpose. Of course if they aren't useful, they should just be removed.


Google doesn't care how you structure your HTML tags. As long as you use a <title> tag, appropriate meta tags, and link with <a href=""> tags, little of your HTML is going to change your SEO.

Google cares far more about your content. Google cares that your page is useful to and usable by your users. Google has long said that they don't give any ranking boosts for HTML correctness. Google doesn't care if pages validate, as long as they render to users in modern browsers. Google doesn't care about semantic correctness, Google cares that users can navigate your site.

Google used to care more about tags. Using headings and bold used to help SEO. Not anymore. Google now renders your pages and sees what words are big and prominent as they are rendered, not based on what tags they are in.

There may be other reasons to structure your HTML tags a certain way. It could make your development standardized. It could help screen readers for blind users. But you shouldn't spend time optimizing your HTML structure for search engines.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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