Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller suggests putting JavaScript code below the HTML header tag to ensure search spiders can fully understand your website.

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

The response is yes; the positioning of HTML code could adversely affect your SEO efforts if it doesn’t appear at the top of the page.

More particularly, it is very important to keep the area of the HTML file at the top of the page. This area must consist of the info that Google needs to read your website correctly.

Any JavaScript code should be positioned listed 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 () need to be basically 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 area.”

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

Mueller continues:

“For the material it doesn’t matter as much, however given that the head things is for machine-readable information that’s confirmed to be in a particular part of the page, it really needs 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 include JavaScript code at the bottom of the HTML document near the closing tag.

That’s since JavaScript can postpone the making of a website while it loads, resulting in a poor user experience.

By placing the JavaScript at the bottom of the page, the HTML can be rendered first, allowing the user to view the content while the JavaScript loads in the background.

Additionally, you can prevent external JavaScript files from obstructing the rendering of the page utilizing the async or delay attributes.

Source: Reddit

Featured Image: StockEU/Best SMM Panel