Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller suggests putting JavaScript code listed below the HTML header tag to make sure search crawlers can fully understand your website.

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

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’s important to keep the area of the HTML file at the top of the page. This area should contain the information that Google needs to read your site effectively.

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

To make sure that the JavaScript isn’t hindering the area, Mueller advises using the rendering tool in Browse Console:

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

Relating to the primary material, Mueller says its positioning is lesser, though it’s crucial 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, but because the head things is for machine-readable info that’s verified to be in a particular part of the page, it truly requires to be clean on top.

Down with JavaScript! (in the )”

Why Does The Placement Of JavaScript Matter For SEO?

When creating a site, 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 rendering of a website while it loads, leading to a bad user experience.

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

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

Source: Reddit

Included Image: StockEU/SMM Panel