Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does "description" in Schema.org markup have to be free of HTML tags?

All e-commerce websites with Product Schema.org Microdata that I found use plain text in description property.

Is there some specification that clearly prohibits markup with some text formatting tags like:

<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="Name" />
<meta itemprop="description" content="<p>First paragraph with <b>bold words<b/>.</p><p>Second paragraph.</p>" />
</div>
like image 742
Kadilov Avatar asked Jan 31 '16 15:01

Kadilov


People also ask

What is schema markup tag?

Schema markup, also known as structured data, is the language search engines use to read and understand the content on your pages. By language, we mean a semantic vocabulary (code) that helps search engines characterize and categorize the content of web pages.

What are schemas in HTML?

Schema.org (often called schema) is a semantic vocabulary of tags (or microdata) that you can add to your HTML to improve the way search engines read and represent your page in SERPs.


2 Answers

If you are using the newer JSON-LD format for schema data then it seems (at least with Google) that it's OK to include HTML markup for some fields - indeed, they actually ask for it. See their recommendation for JobPostings, for example, where they state for description:

The full description of the job in HTML format.

You must format the description in HTML.

Their Structured Data Testing Tool certainly doesn't seem to complain about HTML in fields, though you probably want to limit it to basic tags. Whether other parsers are OK with it is difficult to say.

like image 119
Dan Diplo Avatar answered Oct 19 '22 02:10

Dan Diplo


You are using the meta element. Its content attribute can only contain a string. If you’d provide a value like <b>bold</b>, <b> and </b> would be part of the value, and these would be interpreted as text, not as markup.

For Schema.org’s description property, you can of course use a different element (like p). This may contain markup, but the value for the description property will be the text value.

So for

<p itemprop="description">foo <b>bar</b></p>

the value would be "foo bar".

like image 6
unor Avatar answered Oct 19 '22 04:10

unor