Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

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

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

The response is yes; the positioning of HTML code might negatively impact your SEO efforts if it doesn’t appear at the top of the page.

More specifically, it’s important to keep the area of the HTML file at the top of the page. This section must include the details that Google needs to read your site properly.

Any JavaScript code need to be put below the HTML headers.

To make certain that the JavaScript isn’t interfering with the section, Mueller advises using the rendering tool in Search Console:

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

Relating to the primary material, Mueller says its positioning is less important, though it’s crucial for the section to be tidy and efficient so Googlebot can correctly understand it.

Mueller continues:

“For the content it doesn’t matter as much, but given that the head stuff is for machine-readable info that’s verified to be in a specific part of the page, it really needs to be clean on top.

Down with JavaScript! (in the )”

Why Does The Positioning Of JavaScript Matter For SEO?

When creating a site, 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 making of a webpage while it loads, leading to a poor user experience.

By putting 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.

Furthermore, you can prevent external JavaScript files from obstructing the rendering of the page using the async or delay characteristics.

Source: Reddit

Featured Image: StockEU/SMM Panel