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 completely understand your website.

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

The answer is yes; the positioning of HTML code could negatively affect your SEO efforts if it does not appear at the top of the page.

More particularly, it is necessary to keep the section of the HTML file at the top of the page. This area should include the information that Google requires to read your website effectively.

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

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

“The html headers () must be pretty much on top. I ‘d move any JS to listed below the HTML headers, and contact the rendering tool in search console that the JS does not ruin the section.”

Regarding the primary content, Mueller says its placement is less important, though it’s vital for the section to be tidy and well-organized so Googlebot can properly understand it.

Mueller continues:

“For the content it doesn’t matter as much, however considering that the head things is for machine-readable details that’s verified 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 creating a website, it’s best to include JavaScript code at the bottom of the HTML file near the closing tag.

That’s since JavaScript can postpone the rendering 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 view the material while the JavaScript loads in the background.

Additionally, you can avoid external JavaScript files from blocking the making of the page utilizing the async or defer qualities.

Source: Reddit

Featured Image: StockEU/Best SMM Panel