Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

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

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

The response is yes; the placement of HTML code could negatively affect your SEO efforts if it doesn’t appear at the top of the page.

More particularly, it’s important to keep the area of the HTML file at the top of the page. This section needs to contain the info that Google needs to read your site properly.

Any JavaScript code ought to be put listed below the HTML headers.

To ensure that the JavaScript isn’t interfering with the section, Mueller recommends utilizing the rendering tool in Browse Console:

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

Relating to the main material, Mueller states its positioning is lesser, though it’s essential for the area to be clean and well-organized so Googlebot can properly understand it.

Mueller continues:

“For the content it does not matter as much, however since the head things is for machine-readable information that’s verified to be in a particular part of the page, it really 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 because JavaScript can postpone the making of a website while it loads, leading to a bad user experience.

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

In addition, you can prevent external JavaScript files from obstructing the making of the page utilizing the async or defer qualities.

Source: Reddit

Featured Image: StockEU/Best SMM Panel