Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller suggests positioning JavaScript code listed below the HTML header tag to ensure search spiders can totally comprehend your website.

Mueller shares this advice in a Reddit thread, where a user asks whether HTML code placement could 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 is necessary to keep the area of the HTML file at the top of the page. This area should include the information that Google requires to read your site effectively.

Any JavaScript code ought to be positioned listed below the HTML headers.

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

“The html headers () must be basically 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.”

Relating to the main content, Mueller states its placement is lesser, though it’s vital for the section to be clean and efficient so Googlebot can correctly understand it.

Mueller continues:

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

Down with JavaScript! (in the )”

Why Does The Positioning Of JavaScript Matter For SEO?

When designing a site, it’s best to consist of JavaScript code at the bottom of the HTML document 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 putting the JavaScript at the bottom of the page, the HTML can be rendered initially, allowing the user to view the content 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 delay attributes.

Source: Reddit

Included Image: StockEU/Best SMM Panel