Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

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

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

The answer is yes; the positioning of HTML code could adversely impact your SEO efforts if it does not appear at the top of the page.

More particularly, it is necessary to keep the section of the HTML document at the top of the page. This section ought to include the information that Google requires to read your website appropriately.

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

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

“The html headers () should be basically 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 doesn’t mess up the area.”

Regarding the main material, Mueller states its placement is less important, though it’s crucial for the area to be tidy and efficient so Googlebot can correctly comprehend it.

Mueller continues:

“For the content it doesn’t matter as much, but considering that the head stuff is for machine-readable info that’s validated to be in a specific part of the page, it really requires to be clean on top.

Down with JavaScript! (in the )”

Why Does The Placement Of JavaScript Matter For SEO?

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

That’s since JavaScript can delay the rendering of a webpage while it loads, leading to a bad user experience.

By placing 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 utilizing the async or delay attributes.

Source: Reddit

Featured Image: StockEU/SMM Panel