Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller recommends placing JavaScript code below the HTML header tag to ensure search crawlers can totally understand your site.

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 placement of HTML code could adversely affect your SEO efforts if it does not appear at the top of the page.

More specifically, it is very important to keep the area of the HTML document at the top of the page. This section needs to consist of the info that Google needs to read your site appropriately.

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

To make sure that the JavaScript isn’t hindering the section, Mueller suggests utilizing the rendering tool in Browse Console:

“The html headers () ought to be pretty much 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 mess up the section.”

Concerning the primary material, Mueller states its positioning is less important, though it’s crucial for the area to be clean and well-organized so Googlebot can properly understand it.

Mueller continues:

“For the content it does not matter as much, but because the head stuff is for machine-readable details that’s validated to be in a particular part of the page, it truly needs to be tidy on top.

Down with JavaScript! (in the )”

Why Does The Positioning Of JavaScript Matter For SEO?

When developing a site, it’s finest to consist of JavaScript code at the bottom of the HTML document near the closing tag.

That’s because JavaScript can postpone the rendering of a website while it loads, resulting in a bad user experience.

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

Furthermore, you can prevent external JavaScript files from blocking the rendering of the page using the async or postpone qualities.

Source: Reddit

Featured Image: StockEU/Best SMM Panel