Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller recommends putting JavaScript code below the HTML header tag to make sure search crawlers can completely understand your site.

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

The answer is yes; the positioning of HTML code could adversely impact your SEO efforts if it does not 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 section must consist of the details that Google requires to read your site appropriately.

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

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

“The html headers () must 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 doesn’t screw up the area.”

Regarding the main material, Mueller says its placement is less important, though it’s important 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 stuff is for machine-readable information that’s confirmed to be in a particular part of the page, it really requires 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 finest to consist of JavaScript code at the bottom of the HTML document near the closing tag.

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

By positioning the JavaScript at the bottom of the page, the HTML can be rendered initially, permitting the user to view 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 postpone attributes.

Source: Reddit

Included Image: StockEU/Best SMM Panel