Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

Google’s John Mueller suggests positioning JavaScript code below the HTML header tag to make sure search crawlers can completely understand your site.

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

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

More particularly, it is necessary to keep the section of the HTML document at the top of the page. This section needs to include the information that Google requires to read your website correctly.

Any JavaScript code need to be positioned listed below the HTML headers.

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

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

Regarding the primary material, Mueller says its positioning is lesser, though it’s essential for the section to be clean and well-organized so Googlebot can correctly understand it.

Mueller continues:

“For the content it doesn’t matter as much, but because the head things is for machine-readable details that’s verified to be in a particular part of the page, it really requires to be tidy on top.

Down with JavaScript! (in the )”

Why Does The Placement Of JavaScript Matter For SEO?

When developing 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 delay the rendering of a website while it loads, leading to a bad user experience.

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

Furthermore, you can prevent external JavaScript files from blocking the making of the page utilizing the async or defer characteristics.

Source: Reddit

Featured Image: StockEU/Best SMM Panel