0

I use semantic HTML5 tags for SEO reasons. In react I have some components that they inherit from each other. For example, a parent component has two children. Each outer HTML tag of the child is <main> but when the project will be run, both of the main tags placed on one page. My question is, using multiple <main/> tag in one page (or nested <main/>) causes weakening SEO or not? or using section tag instead div in entire the project?

  • Having two <main> elements is invalid HTML. Having invalid HTML never helps SEO. – Rob Apr 27 at 10:31
2

Having more than one <main> tag is not valid (emphasis added):

The <main> tag specifies the main content of a document.

The content inside the <main> element should be unique to the document. It should not contain any content that is repeated across documents such as sidebars, navigation links, copyright information, site logos, and search forms.

Note: There must not be more than one <main> element in a document. The <main> element must NOT be a descendant of an <article>, <aside>, <footer>, <header>, or <nav> element.

As to whether it would hurt your SEO: probably not. There is no evidence that Google even uses the semantic HTML5 tags for ranking pages. They haven't said one way or the other, and I haven't seen any studies or testing that shed a lot of light on the subject. You can find a lot of articles suggesting you use semantic tags for SEO, but I haven't found one with data showing that it works. I suspect they are mostly written by people who like the idea of semantic tags and promote it as something that might someday help SEO, or by SEO consultants who can make money by reworking your site to use the tags.

Google has long said that they try to rank pages based on how users see them not based on how well they conform to standards. As long as your pages render properly for nearly all users, Google isn't likely to care what tags you used or whether you used tags correctly.

I feel it is unlikely that Google uses semantic HTML5 tags at all. They are not universal. I still don't use them because they are not supported by IE11 which still has over 1% of the browser market. Google has other ways of identifying the parts of your pages by comparing your pages against each other. They have had to develop algorithms for that out of necessity because HTML didn't define semantic markup for that until recently. Google has been burned in the past when trying to rely on data that isn't visible to users for ranking purposes. That is why Google no longer uses meta keywords. If anybody found a way to manipulate rankings with semantic HTML tags, spammers would quickly take advantage of it.

| improve this answer | |
1

Yes it will hurt SEO has the crawler will not know if focus and give importance to the main 1 content or main 2 content or main 3 content. Main is the main part of the page, don't use more than one. Section is a section, you can have many sections. More sections will be seen as positive from crawler as will be considered more explicative of a single object in the same "main" content.

If place sections inside OR outside the main depending on you, it will not hurt SEO.

I would build a page in a very plain way:

<header></header>
<nav></nav>
<main>
    <section></section>
    <section></section>
    <article></article>
</main>
<footer></footer>

The div you can place inside any semantic part for a layout reason or construction/design need.

| improve this answer | |

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.