Multiple and repeated phone numbers in Microdata

- 1 answer

Ad

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 target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="tel:0123132123">Line 1 0123 132 123</a></li>
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="tel:0123546334">Line 2 0123 546 334</a></li>
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="tel:01233456">Line 3 01233456</a></li>
</ul>

2:

<ul>
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="tel:0123132123" itemprop="telephone"> Line 1 0123 132 123</a></li>
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="tel:0123546334" itemprop="telephone">Line 2 0123 546 334</a></li>
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="tel:01233456" itemprop="telephone">Line 3 01233456</a></li>
</ul>

3:

<ul>
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="tel:0123132123"> Line 1 <span itemprop="telephone">0123 132 123</span></a></li>
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="tel:0123546334">Line 2 <span itemprop="telephone">0123 546 334</span></a></li>
    <li><a target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" 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>
Ad

Answer

Ad

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.

Ad
source: stackoverflow.com
Ad