Google’s John Mueller: Move JavaScript Below HTML Headers

Google’s John Mueller recommends putting JavaScript code listed below the HTML header tag to guarantee search spiders can completely comprehend your site.

Mueller shares this suggestions 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 might negatively affect your SEO efforts if it does not appear at the top of the page.

More particularly, it is essential to keep the << head> > area of the HTML file at the top of the page. This area ought to consist of the details that Google requires to read your website correctly.

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

To ensure that the JavaScript isn’t hindering the << head> > area, Mueller suggests utilizing the rendering tool in Browse Console:

” The html headers (<< head>>) must be practically 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 << head> > area.”

Relating to the primary material, Mueller states its positioning is lesser, though it’s important for the << head> > area to be tidy and efficient so Googlebot can correctly comprehend it.

Mueller continues:

” For the material it does not matter as much, however given that the head things is for machine-readable details that’s validated to be in a particular part of the page, it truly requires to be tidy on top.

Down with JavaScript! (in the << head>>)”

Why Does The Positioning Of JavaScript Matter For SEO?

When developing a site, it’s finest to consist of JavaScript code at the bottom of the HTML file near the closing < tag.

That’s since JavaScript can postpone the making of a web page 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, permitting the user to see the material while the JavaScript loads in the background.

In addition, you can avoid external JavaScript files from obstructing the making of the page utilizing the async or postpone characteristics.

Source: Reddit

Included Image: StockEU/Shutterstock

Leave a Reply

Your email address will not be published. Required fields are marked *

Schedule Call

👋🏻 Hi friend, how are you today?

Need help? contact us here... 👇