Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller recommends positioning JavaScript code below the HTML header tag to guarantee search spiders can completely comprehend your website.

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

The response is yes; the placement of HTML code could negatively impact 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 file at the top of the page. This area must consist of the details that Google needs to read your website appropriately.

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

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

“The html headers () should 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 screw up the section.”

Relating to the primary material, Mueller states its placement is less important, though it’s essential for the area to be clean and efficient so Googlebot can appropriately comprehend it.

Mueller continues:

“For the content it doesn’t matter as much, but given that the head things is for machine-readable information that’s verified to be in a particular part of the page, it actually requires to be tidy on top.

Down with JavaScript! (in the )”

Why Does The Placement Of JavaScript Matter For SEO?

When designing a website, it’s best to include JavaScript code at the bottom of the HTML file near the closing tag.

That’s since 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 first, permitting the user to see the material while the JavaScript loads in the background.

Additionally, you can avoid external JavaScript files from obstructing the rendering of the page using the async or defer attributes.

Source: Reddit

Featured Image: StockEU/Best SMM Panel