Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller suggests placing JavaScript code listed below the HTML header tag to ensure search spiders can totally understand your site.

Mueller shares this guidance in a Reddit thread, where a user asks whether HTML code placement could trigger SEO concerns.

The response is yes; the placement of HTML code might adversely impact your SEO efforts if it doesn’t appear at the top of the page.

More specifically, it is essential to keep the section of the HTML document at the top of the page. This section must include the info that Google requires to read your site properly.

Any JavaScript code need to be placed listed below the HTML headers.

To make certain that the JavaScript isn’t disrupting the area, Mueller advises utilizing the rendering tool in Search Console:

“The html headers () need to be pretty much on top. I ‘d move any JS to listed below the HTML headers, and check with the rendering tool in search console that the JS does not ruin the area.”

Regarding the main content, Mueller states its positioning is lesser, though it’s essential for the area to be clean and well-organized so Googlebot can appropriately understand it.

Mueller continues:

“For the material it does not matter as much, however because the head stuff is for machine-readable info that’s validated to be in a specific part of the page, it actually requires to be tidy on top.

Down with JavaScript! (in the )”

Why Does The Placement Of JavaScript Matter For SEO?

When designing a website, it’s best to include JavaScript code at the bottom of the HTML file near the closing tag.

That’s because JavaScript can postpone the making of a webpage while it loads, leading to a poor user experience.

By positioning the JavaScript at the bottom of the page, the HTML can be rendered first, allowing the user to view the material while the JavaScript loads in the background.

In addition, you can prevent external JavaScript files from blocking the making of the page using the async or delay attributes.

Source: Reddit

Featured Image: StockEU/Best SMM Panel