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 make sure search spiders can fully comprehend your site.

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

The response is yes; the positioning of HTML code might adversely impact your SEO efforts if it does not appear at the top of the page.

More particularly, it is necessary to keep the area of the HTML document at the top of the page. This section should contain the info that Google needs to read your site effectively.

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

To ensure that the JavaScript isn’t interfering with the area, Mueller advises using the rendering tool in Search Console:

“The html headers () ought to be basically 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 ruin the area.”

Concerning the primary content, Mueller says its placement is lesser, though it’s essential for the area to be tidy and efficient so Googlebot can correctly understand it.

Mueller continues:

“For the content it doesn’t matter as much, but since the head things is for machine-readable details that’s validated to be in a particular part of the page, it really needs 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 best to include JavaScript code at the bottom of the HTML file near the closing tag.

That’s because 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 initially, permitting the user to see the content while the JavaScript loads in the background.

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

Source: Reddit

Included Image: StockEU/Best SMM Panel