1

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...

0

1 Answer 1

2

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" } } ] }

3
  • Do you know of any negative effects based on this policy from Google: "The meta tag should not be used to hide content that is not visible to users in any form, since it might create misleading or deceptive search experience." - developers.google.com/structured-data/policies Commented Nov 23, 2015 at 15:24
  • it always depends on how you use it. Google is able to see misusage. But i personally haven't seen any negative impact of it.
    – Evgeniy
    Commented Nov 23, 2015 at 15:44
  • 1
    @ElendilTheTall: Regarding the "negative effects", my answer about using Microdata with meta/link elements for Schema.org might be relevant.
    – unor
    Commented Nov 23, 2015 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.