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 guarantee search crawlers can completely comprehend your website.

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

The response 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 essential to keep the area of the HTML document at the top of the page. This section should contain the information that Google needs to read your website effectively.

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

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

“The html headers () need 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 screw up the area.”

Concerning the primary content, Mueller states its positioning is lesser, though it’s important for the area to be tidy and efficient so Googlebot can effectively comprehend it.

Mueller continues:

“For the material it doesn’t matter as much, however considering that the head things is for machine-readable information that’s confirmed to be in a particular part of the page, it truly needs to be tidy on top.

Down with JavaScript! (in the )”

Why Does The Positioning Of JavaScript Matter For SEO?

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

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

By putting the JavaScript at the bottom of the page, the HTML can be rendered initially, permitting the user to see the material while the JavaScript loads in the background.

In addition, you can avoid external JavaScript files from blocking the rendering of the page utilizing the async or defer characteristics.

Source: Reddit

Featured Image: StockEU/Best SMM Panel