: Best way to define 'mainEntityOfPage' in Microdata? I know at least 2 ways to define mainEntityOfPage: <div itemprop="about" itemscope itemtype="http://schema.org/Product"> <link itemprop="mainEntityOfPage"
I know at least 2 ways to define mainEntityOfPage:
<div itemprop="about" itemscope itemtype="http://schema.org/Product">
<link itemprop="mainEntityOfPage" href="http://example.com/article-1" />
</div>
and
<div itemprop="about" itemscope itemtype="http://schema.org/Product">
<meta itemprop="mainEntityOfPage" content="Mycontent" itemscope itemType="https://schema.org/WebPage" itemid="http://example.com/article-1"/>
</div>
Both ways are succesfully validated. The questions are:
Which way is more optimal/universal/recognizible for search engines?
If I markup them both simultaneously is it ok? (Validator gives no errors.)
More posts by @Cugini213
1 Comments
Sorted by latest first Latest Oldest Best
I described the different ways how mainEntityOfPage can be specified in an answer on Stack Overflow.
The difference between your two examples is that the second one creates an item (with the type WebPage), while the first one just points to another page (which might or might not define a type).
From the perspective of Schema.org, both ways are fine. The mainEntityOfPage property expects a URL (= your first example) or a CreativeWork (= your second example) as value.
In my opinion, the second example is not very elegant. The content attribute of the meta element will be ignored (because of the itemscope), but HTML5+Microdata requires it to be there. Pro: it adds (on the source page) the information that the URL represents a web page; in theory, consumers would not have to visit the URL to learn what it represents (= a WebPage). However, that is probably the default assumption in that context anyway.
It shouldn’t matter which way you choose. FWIW, Google’s Testing Tool seems to be fine with both.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.