×
Friday, November 8, 2024

Google's John Mueller: More About Head Section & JavaScript - Search Engine Roundtable

Last updated Monday, January 16, 2023 08:05 ET , Source: NewsService

Last week we reported on a comment made by John Mueller of Google about the head section of your HTML and why you should keep it clean. John, on Friday, posted a Mastodon thread explaining more about the head section and how search engines interact with it, especially if there is a lot of JavaScript in it.

Here is the content from the thread:

SEO in your head vs too much #JavaScript?

This comes up from time to time, I thought I'd be more elaborate once (it's not new). Search engines (I only really know Google, YMMV) render HTML pages and there are some settings that need to be found in the head of a page in order to be valid. If you care about these settings, don't make the brittle, and ideally move those settings to the top of the head.

The SEO settings I'm thinking of are the robots meta tag & the canonical link element, but there's also the title & description meta tag which some people consider important. It's not just about SEO either - you probably also want to make sure things like the character set definition, viewport & CSP are considered valid.

"Of course my head is ok" - sometimes it's not as obvious as clearly broken markup. The head is self-closing, so any HTML element that's not valid in the will result in the rest to be considered as a part of the body. That can be a stray img that ends up somewhere wrong, it could be an iframe that a script injects to the top of the head during rendering. This is visible if you inspect the DOM of a page in your...



Read Full Story: https://news.google.com/__i/rss/rd/articles/CBMiRmh0dHBzOi8vd3d3LnNlcm91bmR0YWJsZS5jb20vZ29vZ2xlLWhlYWQtc2VjdGlvbi1qYXZhc2NyaXB0LTM0NzQwLmh0bWzSAUpodHRwczovL3d3dy5zZXJvdW5kdGFibGUuY29tL2FtcC9nb29nbGUtaGVhZC1zZWN0aW9uLWphdmFzY3JpcHQtMzQ3NDAuaHRtbA?oc=5

Your content is great. However, if any of the content contained herein violates any rights of yours, including those of copyright, please contact us immediately by e-mail at media[@]kissrpr.com.