Mobile app version of vmapp.org
Login or Join
Deb1703797

: Multiple addresses in JSON-LD Schema.org I have a site I am creating for a non-profit organization. Their organization has a United States Mailing Address and a Canada Mailing Address. I want

@Deb1703797

Posted in: #JsonLd #SchemaOrg

I have a site I am creating for a non-profit organization. Their organization has a United States Mailing Address and a Canada Mailing Address. I want to add both addresses with Schema.org (using JSON-LD), but I cannot figure out how. I originally tried this:

"address": {
"@type": "PostalAddress",
"addressCountry": "United States",
"addressLocality": "City",
"addressRegion": "State",
"postalCode": "12345",
"postOfficeBoxNumber": "1234"
},
"address": {
"@type": "PostalAddress",
"addressCountry": "Canada",
"addressLocality": "City",
"addressRegion": "Province ",
"postalCode": "Zip",
"streetAddress": "Box 123 12345 - 123 Street NW"
},


When I run a test on this schema it uses only the last address.

I tried wrapping the addresses using "location": {} but that threw an error.

How would I add both addresses in the Schema.org markup using JSON-LD?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry384

Similar to adding multiple string/URL values: by using an array.

<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"address":
[
{
"@type": "PostalAddress"
},
{
"@type": "PostalAddress"
}
]
}
</script>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme