Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller recommends placing JavaScript code below the HTML header tag to ensure search spiders can completely understand your website.

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

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

More specifically, it is very important to keep the area of the HTML document at the top of the page. This area needs to consist of the information that Google needs to read your website correctly.

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

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

“The html headers () should be pretty much on top. I ‘d move any JS to below the HTML headers, and check with the rendering tool in search console that the JS doesn’t screw up the section.”

Relating to the main material, Mueller says its placement is less important, though it’s crucial for the section to be tidy and efficient so Googlebot can effectively understand it.

Mueller continues:

“For the material it does not matter as much, but considering that the head things is for machine-readable information that’s verified to be in a specific part of the page, it actually requires to be clean on top.

Down with JavaScript! (in the )”

Why Does The Positioning Of JavaScript Matter For SEO?

When designing a website, it’s finest to consist of JavaScript code at the bottom of the HTML document near the closing tag.

That’s because JavaScript can postpone the making of a website while it loads, resulting in a poor user experience.

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

In addition, you can avoid external JavaScript files from blocking the making of the page using the async or defer qualities.

Source: Reddit

Included Image: StockEU/Best SMM Panel