I’m creating Microdata for an organisation and was wondering about the correct way to add multiple phone numbers to a site.
This are a few options I’ve got in mind:
1:
<ul itemprop="telephone">
<li><a href="tel:0123132123">Line 1 0123 132 123</a></li>
<li><a href="tel:0123546334">Line 2 0123 546 334</a></li>
<li><a href="tel:01233456">Line 3 01233456</a></li>
</ul>
2:
<ul>
<li><a href="tel:0123132123" itemprop="telephone"> Line 1 0123 132 123</a></li>
<li><a href="tel:0123546334" itemprop="telephone">Line 2 0123 546 334</a></li>
<li><a href="tel:01233456" itemprop="telephone">Line 3 01233456</a></li>
</ul>
3:
<ul>
<li><a href="tel:0123132123"> Line 1 <span itemprop="telephone">0123 132 123</span></a></li>
<li><a href="tel:0123546334">Line 2 <span itemprop="telephone">0123 546 334</span></a></li>
<li><a href="tel:01233456">Line 3 <span itemprop="telephone">01233456</span></a></li>
</ul>
Also, if the same number has been repeated on a page, will that cause an error even if they are under the same itemscope
?
Example:
<body itemscope itemtype="http://schema.org/Organization">
<span itemprop="telephone">01233456</span>
<!-- data -->
<!-- data -->
<span itemprop="telephone">01233456</span>
<!-- data -->
<!-- data -->
<span itemprop="telephone">01233456</span>
</body>
3
Answers
your mentioned options 1,2,3 won’t work as they will give error! You have itemprop=”telephone” on anchor tags, its not valid markup for schema.
your mentioned example will work, but yes it will give the same number 3 times as shown below in image.
Check yourself on Google Microdata test tool
The
telephone
property expects Text as value. If you want to follow this advice, you should provide this property on an element that generates a string value in Microdata (e.g.span
) instead of an element that generates a URL value (e.g.,a
).And if you want to provide multiple
telephone
values, you have to repeat the property. Providing multiple properties with the same value is not an error, but also not useful (I’d try to avoid it; simply don’t mark up the repeated telephone numbers in the same item).So example 3 is correct.
Note that there is a feature request to also expect URL values for
telephone
. If this happens, your example 2 would also be in line with Schema.org’s advice.Example 1 would represent one telephone number (
Line 1 0123 132 123 Line 2 0123 546 334 Line 3 01233456
), so it’s not correct.I use this one to add the international Prefix:
<a href="tel:+15551234567" rel="nofollow"><span content="+15551234567" itemprop="telephone">(555) 1234 - 567</span></a>
so i can display a human readable format (Like ‘Support’ insteed of (555) 1234 – 567) and give google the expectedt number with +1 the interational prefix.
I removed in content the
- and ()
this is US specific but you can leaved in. I am from outside.And if you add ContactPoint it will display fine in the knowledgegraph.