Discover SEO trends from some of the top SEO professionals. They will tell you just about everything you need to know to succeed in 2023.
Discover SEO trends from some of the top SEO professionals. They will tell you just about everything you need to know to succeed in 2023.
Discover what PPC trends you need to know in 2023 if you want to drive more traffic, leads, and conversions, make the most of your budget, and stay ahead of your competition.
This ebook shows you how to meet customers at each stage of their journey and create compelling content that converts.
Want to know what makes a Facebook ad effective and how to set up your campaigns for success?
How do you create web content that’s digestible for search engines while simultaneously providing a user-friendly experience?
John Mueller from Google advises placing JavaScript code underneath the HTML header to ensure that search engines can clearly understand your website.
Google’s John Mueller suggests placing JavaScript code below the HTML header tag to ensure search crawlers can fully understand your website.
Mueller shares this advice in a Reddit thread, where a user asks whether HTML code placement could cause SEO issues.
The answer is yes; the placement of HTML code could adversely impact your SEO efforts if it doesn’t appear at the top of the page.
More specifically, it’s important to keep the <head> section of the HTML document at the top of the page. This section should contain the information that Google needs to read your site properly.
Any JavaScript code should be placed below the HTML headers.
To make sure that the JavaScript isn’t interfering with the <head> section, Mueller recommends using the rendering tool in Search Console:
“The html headers (<head>) should 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 mess up the <head> section.”
Regarding the main content, Mueller says its placement is less important, though it’s crucial for the <head> section to be clean and well-organized so Googlebot can properly understand it.
Mueller continues:
“For the content it doesn’t matter as much, but since the head stuff is for machine-readable information that’s verified to be in a specific part of the page, it really needs to be clean on top.
Down with JavaScript! (in the <head>)”
When designing a website, it’s best to include JavaScript code at the bottom of the HTML document near the closing </body> tag.
That’s because JavaScript can delay the rendering of a webpage while it loads, resulting in a poor user experience.
By placing the JavaScript at the bottom of the page, the HTML can be rendered first, allowing the user to view the content while the JavaScript loads in the background.
Additionally, you can prevent external JavaScript files from blocking the rendering of the page using the async or defer attributes.
Source: Reddit
Featured Image: StockEU/Shutterstock
Matt G. Southern, Senior News Writer, has been with Search Engine Journal since 2013. With a bachelor’s degree in communications, …
Get our daily newsletter from SEJ’s Founder Loren Baker about the latest news in the industry!
Subscribe to SEJ
Get your daily recap of the latest search news, advice, and trends.
Educating and empowering the SEO community by providing the freshest news and latest best practices via the industry’s smartest practitioners.
Copyright © 2023 Search Engine Journal. All rights reserved. Published by Alpha Brand Media.
11 January, 2023
0 Comment
188 Views
Google's John Mueller: Move JavaScript Below HTML Headers – Search Engine Journal
by Jason Peters
Discover SEO trends from some of the top SEO professionals. They will tell you just about everything you need to know to succeed in 2023.Discover SEO trends from some of the top SEO professionals. They will tell you just about everything you need to know to succeed in 2023.Discover what PPC trends you need to... Read More