I'm using some Microdata to describe a blog post, and I'm surprised by the value return for Schema.org’s BlogPosting
by the Google Developers Testing Tool.
I would have expected it to be the itemprop url
, not a merge of the website URL and the item id
.
Am I doing something wrong, or is it only a Google display issue?
<div itemscope="itemscope"
itemprop="blogPost"
itemtype="http://schema.org/BlogPosting"
id="foobar">
<a itemprop="url" href="/realone">real</a>
</div>
Value returned by https://developers.google.com/structured-data/testing-tool/:
BlogPosting: http://www.example.com/foobar
url: http://www.example.com/realone
Microdata is an attempt to provide a simpler way of annotating HTML elements with machine-readable tags than the similar approaches of using RDFa and classic microformats. At a high level, microdata consists of a group of name-value pairs. The groups are called items, and each name-value pair is a property.
The microdata tags can help your site get indexed and ranked more accurately, and the resulting rich snippets can help your site stand out from others on the results page and drive more traffic to you.
Microdata. An open-community HTML specification used to nest structured data within HTML content. Like RDFa, it uses HTML tag attributes to name the properties you want to expose as structured data. It is typically used in the page body, but can be used in the head.
LAST UPDATED: MAY 31, 2022. URL schema is used as an identifier in launching applications and performing a set of commands in iOS devices. The schema name of a URL is the first part of a URL. (e.g. schemaname:// ). For web pages, the schemas are usually http or https.
This is strange.
It’s definitely not conforming to the Microdata Note. Apart from Microdata’s itemref
attribute, HTML5’s id
attribute has no special meaning in Microdata.
If Google wants to use the id
value anyway, they should at least generate the URL with a fragment identifier, i.e., http://www.example.com/#foobar
.
My guess is that they are (probably unintentionally) handling HTML5’s id
attribute the same way as Microdata’s itemid
attribute. If using itemid
instead of id
in your example, Google’s Testing Tool output is the same, but this time correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With