Recently, there was a discussion on Twitter about the validity of custom elements in a sectionfrom web pages.
Custom elements are part of the Web Components specification, which allows developers to create HTML elements tailored to their needs.
With custom tags, developers can create reusable, self-contained HTML elements that work independently of the rest of the code.
On Twitter, one individual asks: “Does anyone know if it’s technically valid to have a custom element in the document header?”
John Mueller, a Google search attorney, Proposal This practice may disrupt the way Google displays and indexes the page.
“Using custom elements inTo disable page rendering in Google Search. If there are “search” meta tags, etc., below the custom items they should be in (such as noindex bots), Google may not recognize them during rendering. “
Understand how Google displays web pages
To fully understand the implications of Mueller’s statement, it’s important to understand how Google renders web pages.
The serving process is similar to cooking, turning the recipe into the final product that users see in their browsers.
When the Google crawler retrieves the HTML, it starts the rendering process by interpreting the code and collecting resources to display the webpage visually.
SEO implications of custom HTML tags
While custom tags benefit developers, their impact on SEO cannot be ignored.
Custom tags can affect SEO because search engines like Google traditionally rely on standard HTML tags to understand page content and structure.
For example, if a custom element is used inGoogle may not recognize the standard tags that follow during rendering.
This may cause Google to lose important SEO-related meta tags.
The argument against using custom HTML tags
Although custom HTML tags provide flexibility, there are reasons to use them with caution.
In addition to Mueller’s concerns, custom HTML tags can potentially cause compatibility issues with older browsers and screen readers.
There are also potential global namespace conflicts and concerns about separation of function, meaning, and presentation.
Alternative: JSON-LD tags
For those who want to improve their SEO while retaining the flexibility of custom tags, JSON-LD tags are a promising alternative.
When organized properly, this data can be used in a tag