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 ensure search crawlers can completely comprehend your site.

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

The response is yes; the placement of HTML code could negatively impact your SEO efforts if it doesn’t appear at the top of the page.

More specifically, it is essential to keep the area of the HTML file at the top of the page. This area needs to consist of the details that Google requires to read your website appropriately.

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

To ensure that the JavaScript isn’t disrupting the section, Mueller recommends using the rendering tool in Search Console:

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

Concerning the main material, Mueller states its positioning is lesser, though it’s essential for the area to be clean and well-organized so Googlebot can appropriately comprehend it.

Mueller continues:

“For the content it does not matter as much, however given that the head things is for machine-readable information that’s verified to be in a particular part of the page, it really needs to be tidy on top.

Down with JavaScript! (in the )”

Why Does The Positioning Of JavaScript Matter For SEO?

When developing a website, 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 webpage while it loads, leading to a bad user experience.

By putting the JavaScript at the bottom of the page, the HTML can be rendered initially, enabling the user to view the content while the JavaScript loads in the background.

Additionally, you can avoid external JavaScript files from blocking the rendering of the page using the async or postpone characteristics.

Source: Reddit

Featured Image: StockEU/Best SMM Panel