Mobile app version of vmapp.org
Login or Join
Lee4591628

: How can I add schema.org microdata to a site without displaying it on the page? I am adding microdata to a site which displays events. After running it through Google's Structured Data Tester,

@Lee4591628

Posted in: #SchemaOrg #StructuredData

I am adding microdata to a site which displays events. After running it through Google's Structured Data Tester, it tells me that I need to include address information for the event venue. If I use:

<td itemprop="location" itemscope itemtype="https://schema.org/Place">
<a href="#" target="_blank">Hooville</a>
<div itemprop="address">
<meta itemprop="addressLocality" >Anystate, USA</meta>
</div>
</td>


It displays 'Anystate, USA' on the page - I don't want this to happen. I've tried:

<td itemprop="location" itemscope itemtype="https://schema.org/Place">
<a href="#" target="_blank">Hooville</a>
<div itemprop="address">
<meta itemprop="addressLocality" content="Anystate, USA">
</div>
</td>


But the SDT then no longer finds the address. So, how can I add in the address data without actually displaying it?

EDIT: after a quick look I note that Google doesn't like the use of meta tags to hide content, and that it doesn't like hidden content full stop. So I am between a rock and a hard place - I don't want to display full address details in that part of the site, but the SDT says it should be there...

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Lee4591628

1 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

There are two possibilities:


you use meta, but correctly, like me:


<div itemscope itemtype="https://schema.org/Place">
<meta itemprop="name" content="Hooville" >
<a href="http://www.example.com" itemprop="url">Hooville</a>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="addressLocality" content="Anystate, USA">
</div>
</div>


or you go the way of JSON-LD and write the JSON-LD snippet into the head of the page like


{
"@context": {
"schema": "http://schema.org/"
},
"@graph": [
{
"@id": "_:Nf4d71df24b5444298f9c170e1337ec1b",
"@type": "schema:PostalAddress",
"schema:addressLocality": "Anystate, USA"
},
{
"@id": "",
"rdfa:usesVocabulary": {
"@id": "schema:"
}
},
{
"@id": "_:N980cf56db1b7422b80fd7c37ed95951e",
"@type": "https://schema.org/Place",
"https://schema.org/address": {
"@id": "_:Nf4d71df24b5444298f9c170e1337ec1b"
},
"https://schema.org/name": "Hooville",
"https://schema.org/url": {
"@id": "http://www.example.com"
}
}
]
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme