: Itemprop for canonical link and meta description in the head I've a problem with validation of the code provided by Google. Idea is (simplified): <head itemscope itemtype="http://schema.org/WebSite">
I've a problem with validation of the code provided by Google. Idea is (simplified):
<head itemscope itemtype="http://schema.org/WebSite">
<title itemprop="name">Example.com - Best Website in the World</title>
<meta name="description" content="Blah Blah Blah" itemprop="description">
<link rel="canonical" href="https://example.com/" itemprop="url">
</head>
Inspired by Google documentation (see markup example).
The main problem is that the code above isn't valid:
Attribute itemprop not allowed on element meta at this point.
Attribute itemprop not allowed on element link at this point.
But if I remove itemprop, Google Structure Tool no longer recognizes the url and description as properties.
Please tell me why is that, I mean why does Google provide non-valid code and how can I solve this?
More posts by @Angela700
1 Comments
Sorted by latest first Latest Oldest Best
The example is invalid HTML+Microdata. It is not allowed to have the itemprop attribute on meta[name] or link[rel] elements.
The solution for HTML+Microdata would be to duplicate the elements:
<head itemscope itemtype="http://schema.org/WebSite">
<title itemprop="name">Example.com - Best Website in the World</title>
<meta name="description" content="Blah Blah Blah">
<meta itemprop="description" content="Blah Blah Blah">
<link rel="canonical" href="https://example.com/">
<link itemprop="url" href="https://example.com/">
</head>
With HTML+RDFa, it’s possible to mix:
<head typeof="schema:WebSite">
<title property="schema:name">Example.com - Best Website in the World</title>
<meta name="description" property="schema:description" content="Blah Blah Blah">
<link rel="canonical" property="schema:url" href="https://example.com/">
</head>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.