Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller recommends positioning JavaScript code listed below the HTML header tag to make sure search crawlers can totally understand your website.

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

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

More particularly, it’s important to keep the area of the HTML document at the top of the page. This section needs to consist of the info that Google requires to read your website correctly.

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

To ensure that the JavaScript isn’t interfering with the section, Mueller suggests using the rendering tool in Browse Console:

“The html headers () must 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 does not screw up the section.”

Regarding the main content, Mueller states its placement is lesser, though it’s crucial for the area to be tidy and well-organized so Googlebot can effectively comprehend it.

Mueller continues:

“For the material it does not matter as much, but since the head things is for machine-readable information that’s confirmed to be in a particular part of the page, it really requires to be tidy 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 delay the rendering of a web page while it loads, leading to a bad user experience.

By positioning 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 prevent external JavaScript files from blocking the rendering of the page using the async or delay qualities.

Source: Reddit

Included Image: StockEU/Best SMM Panel