2

The question is about using Microdata to replace entities inside the Schema.org properties description or articleBody:

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (<a href="http://winchdesign.com" target="_blank">winchdesign.com</a>)</p>

if we replace entities it will show:

&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.  (&lt;a href=&quot;http://winchdesign.com&quot; target=&quot;_blank&quot;&gt;winchdesign.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;(&lt;a href=&quot;http://robbreport.com&quot; target=&quot;_blank&quot;&gt;robbreport.com&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;

Is that allowed in Microdata?

1 Answer 1

2

The Schema.org properties articleBody and description expect Text as value. If you want to follow this advice, you have to specify the properties (in itemprop) on an element that creates a string value (these are most elements, e.g., div).

So let’s say you use <div itemprop="articleBody"></div>. It’s the textContent of that element that will be used as value.

First example

<div itemprop="articleBody">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (<a href="http://winchdesign.com" target="_blank">winchdesign.com</a>)</p>
</div>

It generates this property value:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (winchdesign.com)

As you can see, this is readable text. This is what you probably want to provide.

Second example

<div itemprop="articleBody">
  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.  (&lt;a href=&quot;http://winchdesign.com&quot; target=&quot;_blank&quot;&gt;winchdesign.com&lt;/a&gt;)&lt;/p&gt;
  &lt;p&gt;(&lt;a href=&quot;http://robbreport.com&quot; target=&quot;_blank&quot;&gt;robbreport.com&lt;/a&gt;)&lt;/p&gt;
  &lt;p&gt;&nbsp;&lt;/p&gt;
</div>

It generates this property value:

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. (<a href="http://winchdesign.com" target="_blank">winchdesign.com</a>)</p> <p>(<a href="http://robbreport.com" target="_blank">robbreport.com</a>)</p> <p> </p>

As you can see, this text contains parts that look like HTML, but they will be interpreted as plain text (!). So this probably not what you want to provide.

To give a clearer example:

  • <span itemprop="name">John</span>: The name is "John".
  • <span itemprop="name"><b>John</b></span>: The name is "John".
  • <span itemprop="name">&lt;b&gt;John&lt;/b&gt;</span>: The name is "<b>John</b>".
3
  • That @unor is a very clear explanation I really appreciate it , but what about JSON-LD What if, I pass the html tags there??? Thanks
    – Locke
    Mar 1, 2016 at 21:02
  • @Locke: If embedded in HTML, I guess the same rules should apply, i.e., whatever are the rules for script elements (ref. the thread HTML Entities and Escaping in JSON-LD Literals and the spec section Embedding JSON-LD in HTML Documents), but I didn’t look into it. (Anyway, would be a topic for a separate question.)
    – unor
    Mar 1, 2016 at 21:47
  • Well , in the mean time , Yandex din't pass the test , but I get everything green in Google . Let's wait to see what does webmaster tools have to say.
    – Locke
    Mar 2, 2016 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.