Google’s John Mueller said
It suggests “cleaning up” the HTML elements section so that search crawlers can fully understand your website.Mueller shared this advice in a Reddit thread. A user asks if the placement of the HTML code could cause her SEO problems.
The answer is yes. Not putting the HTML code at the top of the page can negatively impact your SEO efforts.
Notes on Mueller’s remarks
John Mueller uses the term HTML header. But usually
Elements are not referenced as such.- HTML header In general,
It is understood to refer to elements (H1, H2, H3, etc.). - header element
A specific HTML element called . - Head HTML element A section at the top of an HTML document that contains metadata about the document itself.
So when Mueller refers to “headers” he specifically means
We are discussing elements.John Mueller on JavaScript in Head Elements
Mueller’s intention is that the HTML document
It was to emphasize the importance of organizing sections and organizing them with scripts that could be placed elsewhere. The element should only contain metadata about the document itself for use by browsers and search engines. This allows search engines to understand what the page is about and provide data to browsers and search engines to properly render the web page (that is, display it). correctly). Some JavaScript code that can be placed after an element should be placed after it. After moving the JavaScript out of the section, Mueller recommends using Search Console’s rendering tools to see if the page is rendering correctly after the move.“html header (
) should be almost at the top. Move the JS below the HTML header and in the Search Console rendering tool, the JS will appear as Make sure you didn’t mess up the section. “
As for the main content, Mueller says its placement isn’t that important, but so that Googlebot can understand it properly,
It is important to keep the sections organized and organized.Muller continues:
“It’s less important with regards to content, but the head part is for machine-readable information that has been identified to be in a specific part of the page, so it needs to be clean on top.
Down with JavaScript! (
inside)”
Why is JavaScript placement important for SEO?
When designing your website, we recommend using the async and defer attributes in strategic ways to achieve the best rendering and interactivity with the best page speed for your users.
This is because JavaScript can delay rendering while a web page is loading, degrading the user experience.
Render the HTML first to allow the user to view the content while the JavaScript loads in the background using the defer and async attributes appropriately.
sauce: Reddit
Featured Image: StockEU/Shutterstock
var s_trigger_pixel_load = false; function s_trigger_pixel(){ if( !s_trigger_pixel_load ){ striggerEvent( 'load2' ); console.log('s_trigger_pix'); } s_trigger_pixel_load = true; } window.addEventListener( 'cmpready', s_trigger_pixel, false);
window.addEventListener( 'load2', function() {
if( sopp != 'yes' && !ss_u ){
!function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window,document,'script', 'https://connect.facebook.net/en_US/fbevents.js');
if( typeof sopp !== "undefined" && sopp === 'yes' ){ fbq('dataProcessingOptions', ['LDU'], 1, 1000); }else{ fbq('dataProcessingOptions', []); }
fbq('init', '1321385257908563');
fbq('track', 'PageView');
fbq('trackSingle', '1321385257908563', 'ViewContent', { content_name: 'googles-john-mueller-move-javascript-below-html-head', content_category: 'news seo' }); } });