Google’s John Mueller: Move JavaScript Below HTML Headers

Posted by

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

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

The answer is yes; the positioning of HTML code might negatively impact your SEO efforts if it doesn’t appear at the top of the page.

More specifically, it’s important to keep the section of the HTML document at the top of the page. This area needs to consist of the information that Google needs to read your website effectively.

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

To make certain that the JavaScript isn’t interfering with the area, Mueller suggests using the rendering tool in Search Console:

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

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

Mueller continues:

“For the content it does not matter as much, but since the head things is for machine-readable info that’s validated to be in a specific part of the page, it actually needs to be clean on top.

Down with JavaScript! (in the )”

Why Does The Positioning Of JavaScript Matter For SEO?

When designing a website, it’s best to include JavaScript code at the bottom of the HTML document near the closing tag.

That’s since JavaScript can postpone the rendering of a web page while it loads, resulting in a bad user experience.

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

Furthermore, you can prevent external JavaScript files from obstructing the rendering of the page utilizing the async or postpone attributes.

Source: Reddit

Featured Image: StockEU/Best SMM Panel