Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

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

Mueller shares this recommendations 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 could adversely impact your SEO efforts if it doesn’t 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 section should contain the information that Google needs to read your website appropriately.

Any JavaScript code should be placed below the HTML headers.

To make certain that the JavaScript isn’t disrupting the area, Mueller advises using 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 talk to the rendering tool in search console that the JS does not screw up the area.”

Concerning the main material, Mueller states its positioning is lesser, though it’s important for the section to be clean and well-organized so Googlebot can appropriately understand it.

Mueller continues:

“For the material it does not matter as much, however considering that the head stuff is for machine-readable info that’s verified to be in a particular part of the page, it truly needs to be clean on top.

Down with JavaScript! (in the )”

Why Does The Positioning Of JavaScript Matter For SEO?

When creating a site, it’s best to include JavaScript code at the bottom of the HTML file near the closing tag.

That’s due to the fact that JavaScript can postpone the rendering of a website while it loads, resulting in a poor user experience.

By positioning the JavaScript at the bottom of the page, the HTML can be rendered first, enabling the user to see the material while the JavaScript loads in the background.

In addition, you can prevent external JavaScript files from blocking the making of the page utilizing the async or postpone attributes.

Source: Reddit

Featured Image: StockEU/Best SMM Panel