Recently, there was a discussion on Twitter about the validity of using custom elements in the
website section.Custom elements are part of the web component specification, allowing developers to create HTML elements tailored to their needs.
Using custom tags, developers can create self-contained, reusable HTML elements that work independently from the rest of the code.
On Twitter, one person asks, “Does anyone know if it’s technically valid to have a custom element in the document header?”
John Mueller, advocate for Google Search, suggested that this practice could alter the way Google renders and indexes the page.
Mueller states:
“Using custom elements in the
probably breaks page rendering in Google Search. If there are “search” meta tags, etc. below the custom elements that should be there (like noindex robots), may not be recognized by Google during rendering.”Understand how Google renders web pages
To fully understand the implications of Mueller’s statement, it’s important to understand how Google renders web pages.
You can think of a web page’s HTML as a recipe and resources like CSS, JavaScript, images and videos as ingredients.
The rendering process is like cooking, transforming the recipe into the final product that users see in their browsers.
As the Google crawler retrieves the HTML, the rendering process begins by interpreting the code and gathering the resources to visually display the web page.
The 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 the content and structure of a page.
For example, if a custom element is used in the file
Google may not recognize the standard tags that follow during rendering.This could cause Google to miss important SEO-relevant meta tags.
The argument against using custom HTML tags
Although custom HTML tags offer flexibility, there are reasons to use them with caution.
In addition to Mueller’s concerns, custom HTML tags can cause compatibility issues with older browsers and screen readers.
There are also potential global namespace clashes and concerns about separating functionality, meaning, and presentation.
An alternative: JSON-LD tags
For those looking to improve SEO while retaining the flexibility of custom tags, JSON-LD tags are a promising alternative.
JSON-LD, or JavaScript Object Notation for Linked Data, provides a method for encoding linked data using JSON.
When properly structured, this data can be used in a
[ad_2]
Source link