Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller suggests placing JavaScript code below the HTML header tag to make sure search crawlers can totally comprehend your website.

Mueller shares this guidance in a Reddit thread, where a user asks whether HTML code positioning might cause SEO issues.

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

More specifically, it is necessary to keep the area of the HTML document at the top of the page. This section must include the information that Google needs to read your website correctly.

Any JavaScript code should be positioned below the HTML headers.

To make sure that the JavaScript isn’t disrupting the section, Mueller advises utilizing the rendering tool in Search Console:

“The html headers () need to be practically on top. I ‘d move any JS to listed below the HTML headers, and check with the rendering tool in search console that the JS does not mess up the section.”

Relating to the main material, Mueller states its positioning is less important, though it’s important for the section to be tidy and efficient so Googlebot can properly comprehend it.

Mueller continues:

“For the material it does not matter as much, however because the head things is for machine-readable details that’s confirmed to be in a particular 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 creating a website, it’s finest 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, resulting in a bad user experience.

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

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

Source: Reddit

Included Image: StockEU/Best SMM Panel