Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

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

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

The answer is yes; the positioning of HTML code might negatively affect your SEO efforts if it does not appear at the top of the page.

More particularly, it is very important to keep the area of the HTML file at the top of the page. This section must consist of the details that Google requires to read your site appropriately.

Any JavaScript code should be placed listed below the HTML headers.

To make certain that the JavaScript isn’t hindering the section, Mueller suggests utilizing the rendering tool in Browse Console:

“The html headers () ought to be practically on top. I ‘d move any JS to listed below the HTML headers, and talk to the rendering tool in search console that the JS does not mess up the section.”

Relating to the main material, Mueller says its placement is lesser, though it’s crucial for the area to be tidy and efficient so Googlebot can properly comprehend it.

Mueller continues:

“For the material it doesn’t matter as much, but given that the head things is for machine-readable details 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 consist of JavaScript code at the bottom of the HTML file near the closing tag.

That’s due to the fact that JavaScript can postpone the making of a website while it loads, leading to a poor user experience.

By placing the JavaScript at the bottom of the page, the HTML can be rendered first, enabling the user to see the material while the JavaScript loads in the background.

Additionally, you can avoid external JavaScript files from blocking the making of the page utilizing the async or postpone characteristics.

Source: Reddit

Featured Image: StockEU/Best SMM Panel