# Schema.org microdata code check

I updated my code based on the feedback from my previous question. There is one for the home page and one for the product pages:

<div itemscope itemtype="http://schema.org/TravelAgency">
<span itemprop="name">NAME OF TRAVEL AGENCY</span>
<span itemprop="description">SHORT DESCRIPTION OF THE TRAVEL AGENCY</span>
</div>


Product page code:

<body itemscope itemtype="http://schema.org/MedicalWebPage">
<link itemprop="author" href="http://schema.org/TravelAgency" />

<link itemprop="specialty" href="http://schema.org/PlasticSurgery" />
<meta itemprop="aspect" content="treatment"/>

<span itemprop="name">TITLE OF PAGE</span>
<span itemprop="description">SHORT DESCRIPTION OF PAGE CONTENT</span>
<img itemprop="image" src="NAME OF IMAGE ON THIS PAGE.jpg" alt="ALT NAME OF IMAGE"/>

<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
The cost of
<span itemprop="itemOffered">NAME OF TREATMENT</span>
<span itemprop="alternateName">ALTERNATE NAME OF TREATMENT</span> is <span itemprop="priceCurrency" content="EUR">€</span><span itemprop="price" content="600.00">600.00</span>
</span>
</body>

• I'm confused by the question. Is this describing some travel agency that offers plastic surgery? – 200_success Jan 20 '15 at 7:33
• @200_success It's both. the question was how to combine both categories. – Julien Jan 22 '15 at 7:01

## Home page (TravelAgency)

Looks correct.

Note that you could (if you want) use this item on every page of your website, not only on the home page.

Typically, you could always use this item for marking up the header of each page. By using its url property, you always link back to the same URL (i.e., your home page’s URL), so consumers can understand that it’s always the same TravelAgency entity.

## Product page (MedicalWebPage)

Your use of the properties specialty, aspect, name, description, and image is correct.

### author property

The value of the author property needs to be the URL of the author, not the URL of the Schema.org type.

Schema.org expects an Organization/Person as value, so you could make this explicit by using:

<span itemprop="author" itemscope itemtype="http://schema.org/TravelAgency">
</span>


If you don’t want to use so "much" markup, you could also simply link directly:

<link itemprop="author" href="HOME PAGE URL" />


However, most sites have a link to the home page anyway (i.e., in the logo or the navigation), so you could reuse this link instead of duplicating it with link.

### url property

The value of the url property would have to be the URL of this MedicalWebPage, not the URL of your homepage.

It doesn’t hurt to have it, but it isn’t really needed in the first place (as it’s just the URL of the current document anyway).

You could, if you want, combine this with a possible rel-canonical in your head.

### offers property

Using the offers property on MedicalWebPage would mean that you are offering this web page (e.g., for sale), as its definition says (bold emphasis mine):

An offer to provide this item […]

This is probably not what you want to say, or is it?

## Offer

### itemOffered property

The itemOffered property expects a Product as value. This is not required (using text, like you do, is allowed), but if you want to go the extra mile, make it a Product item:

<span itemprop="itemOffered" itemscope itemtype="http://schema.org/Product">
<span itemprop="name">NAME OF TREATMENT</span>
</span>


### span element can’t have a content attribute

In HTML5/Microdata, only the meta element can have a content attribute, so it’s not allowed on span.

Instead of <span itemprop="priceCurrency" content="EUR">€</span>, you might want to use:

<meta itemprop="priceCurrency" content="EUR">€


And instead of <span itemprop="price" content="600.00">600.00</span>:

<span itemprop="price">600.00</span>

• Thx for great feedback! For Product Page: 1. I will use the TravelAgency code in the header of each page. In this case do I still need the author property? <link itemprop="author" href="HOME PAGE URL" /> 2. I will take out the url property altogether as it doesn't add useful information. 3. For Offer, yes it makes sense! – Julien Jan 20 '15 at 8:58
• @Julien: 1. I think it would be useful. But then you could point the author property to this item (instead of linking to its URL). You may need the itemref attribute for this, depending on your markup. 2. I’d at least keep it inside TravelAgency (to link to the homepage of your travel agency site). – unor Jan 20 '15 at 14:51
• I have tested the code in Google rich snippets tool. google.com/webmasters/tools/… It gives me an error for author. I read in the forum that the Google tool highlights error while recognising the property. Should I: 1. Pay attention to the error message? 2. Add the Organization category in the header above TravelAgency? 3. Use another property? I have tried agent but it gives me the same error message? 4. Use this code: <div itemscope itemtype="schema.org/TravelAgency" itemref="schema-organization"> – Julien Jan 22 '15 at 7:09
• @Julien: I think the comments are the wrong place to answer these questions; you might want to create a new question on Stack Overflow for this. --- FWIW, Google has a new testing tool: developers.google.com/webmasters/structured-data/testing-tool – unor Jan 22 '15 at 12:48
• I have created a new question in code check: codereview.stackexchange.com/questions/78537/… It combines several of your answers. Thanks for your help! – Julien Jan 25 '15 at 9:15