Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller recommends putting JavaScript code listed below the HTML header tag to make sure search spiders can completely comprehend your website.

Mueller shares this advice in a Reddit thread, where a user asks whether HTML code positioning might cause 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 particularly, it is essential to keep the area of the HTML document at the top of the page. This area needs to contain the details that Google needs to read your website properly.

Any JavaScript code should be positioned listed below the HTML headers.

To make certain that the JavaScript isn’t interfering with the area, Mueller advises using the rendering tool in Search Console:

“The html headers () should be pretty much on top. I ‘d move any JS to below the HTML headers, and talk to the rendering tool in search console that the JS does not mess up the area.”

Regarding the main content, Mueller says its positioning is lesser, though it’s vital for the area to be tidy and well-organized so Googlebot can effectively understand it.

Mueller continues:

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

Down with JavaScript! (in the )”

Why Does The Placement Of JavaScript Matter For SEO?

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

That’s due to the fact that JavaScript can delay the making of a webpage while it loads, resulting in a poor user experience.

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

Additionally, you can avoid external JavaScript files from blocking the rendering of the page utilizing the async or defer attributes.

Source: Reddit

Included Image: StockEU/Best SMM Panel