Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller suggests placing JavaScript code listed below the HTML header tag to ensure search spiders can totally understand your site.

Mueller shares this advice in a Reddit thread, where a user asks whether HTML code placement could trigger SEO issues.

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

More specifically, it is essential to keep the area of the HTML document at the top of the page. This area ought to consist of the information that Google requires to read your website properly.

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

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

“The html headers () need to be pretty much on top. I ‘d move any JS to listed below the HTML headers, and check with the rendering tool in search console that the JS doesn’t ruin the section.”

Concerning the primary content, Mueller states its placement is less important, though it’s important for the section to be clean and well-organized so Googlebot can effectively comprehend it.

Mueller continues:

“For the content it does not matter as much, but since the head stuff is for machine-readable info that’s confirmed 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 Positioning Of JavaScript Matter For SEO?

When developing a site, it’s finest 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 website while it loads, resulting in a poor user experience.

By placing the JavaScript at the bottom of the page, the HTML can be rendered initially, permitting the user to see the material while the JavaScript loads in the background.

Furthermore, you can avoid external JavaScript files from blocking the making of the page using the async or delay attributes.

Source: Reddit

Included Image: StockEU/Best SMM Panel