Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller suggests putting JavaScript code listed below the HTML header tag to ensure search spiders can fully understand your website.

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

The answer is yes; the placement of HTML code might negatively impact your SEO efforts if it doesn’t 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 area should include the info that Google needs to read your site correctly.

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

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

“The html headers () need to be practically 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 area.”

Regarding the primary content, Mueller says its positioning is less important, though it’s crucial for the section to be clean and efficient so Googlebot can effectively comprehend it.

Mueller continues:

“For the material it doesn’t matter as much, however considering that the head stuff is for machine-readable information that’s confirmed to be in a specific part of the page, it actually requires to be clean on top.

Down with JavaScript! (in the )”

Why Does The Placement Of JavaScript Matter For SEO?

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

That’s since JavaScript can postpone the making of a webpage while it loads, leading to a bad user experience.

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

Additionally, you can avoid external JavaScript files from obstructing the making of the page using the async or delay characteristics.

Source: Reddit

Included Image: StockEU/Best SMM Panel