Title: Google Event Markup (JSON)
Last modified: December 9, 2017

---

# Google Event Markup (JSON)

 *  Resolved [jedney](https://wordpress.org/support/users/jedney/)
 * (@jedney)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/google-event-markup-json/)
 * Thanks for all your efforts with EME, it’s a great plugin and has helped me get
   a small community group off the ground.
 * I would like to improve my site by getting the EME events to show properly in
   Google search results. The best way to do this seems to be to embed a JSON LD
   object into each event page with the event details. I’ve tried doing this by 
   adding the following SCRIPT block under the HTML in the “Default single event
   format” field in the Event, Settings page:
 * {I’ve removed the leading < on the SCRIPT tag so it isn’t stripped/processed 
   by the forum!}
 * SCRIPT type=”application/ld+json”>
    { “@context”: “[http://schema.org&#8221](http://schema.org&#8221);,“
   @type”: “Event”, “location”: { “@type”: “Place”, “address”: { “@type”: “PostalAddress”,“
   addressLocality”: “#_TOWN”, “addressRegion”: “#_STATE”, “postalCode”: “#_ZIP”,“
   streetAddress”: “#_ADDRESS” }, “name”: “#_LOCATIONNAME” }, “name”: “#_EVENTNAME”,“
   offers”: { “@type”: “Offer”, “price”: “#_PRICE”, “priceCurrency”: “#_CURRENCY”,“
   url”: “#_EXTERNALURL” }, “startDate”: “#_{Y-m-d}T#_24HSTARTTIME”, “endDate”: “#
   @_{Y-m-d}T#_24HENDTIME”, “description”: “#_EVENTDETAILS”, “isAccessibleForFree”:
   true, “maximumAttendeeCapacity”: “#_TOTALSPACES”, “remainingAttendeeCapacity”:“#
   _AVAILABLESPACES”, “url”: “#_EXTERNALURL” } /SCRIPT>
 * Unfortunately the SCRIPT block is stripped out when the settings are saved.
 * Is there a better way to do this?
    Could this maybe be considered for a new feature
   in a future version?
 * Thanks for your help!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgoogle-event-markup-json%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9775938)
 * Google understands the simple commonly used meta-tags (like description), and
   those can/should be added to the EME option “Extra event html headers” (in the“
   Others” section of the EME settings). Search the internet for “google metatags”
   for more info.
 *  Thread Starter [jedney](https://wordpress.org/support/users/jedney/)
 * (@jedney)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9804891)
 * Thanks Franky.
 * For anyone else trying to do this, here’s some sample code which you can include
   in your site (I ended up putting it under the “Default single event format” HTML
   in the “Events” tab of Settings):
 *     ```
       <div itemscope itemtype="http://schema.org/Event" style="display:none">
         <meta itemprop="description" content="#_NOTES">
         <meta itemprop="remainingAttendeeCapacity" content="#_TOTALSPACES">
         <meta itemprop="remainingAttendeeCapacity" content="#_AVAILABLESPACES">
         <meta itemprop="startDate" content="#_{Y-m-d}T#_24HSTARTTIME">
         <meta itemprop="endDate" content="#@_{Y-m-d}T#_24HENDTIME">
         <img itemprop="image" src="#_EVENTIMAGEURL" alt=""/>
         <link itemprop="url" href="#_EXTERNALURL" rel="author"/>
         <a itemprop="url" href="#_EXTERNALURL">
         <span itemprop="name">#_EVENTNAME</span></a>
         <div itemprop="location" itemscope itemtype="http://schema.org/Place">
           <span itemprop="name" style="display:block;">#_LOCATIONNAME</span>
           <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
             <span itemprop="streetAddress" style="display:block;">#_ADDRESS</span>
           <div>
           <span itemprop="addressLocality" style="display:block;">#_TOWN</span>,
           <span itemprop="addressRegion"style="display:block;">#_STATE</span>
         </div>
         <span itemprop="postalCode"style="display:block;">#_ZIP</span>
         <span itemprop="addressCountry"style="display:block;">#_COUNTRY</span>
       </div>
       ```
   
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9805223)
 * Nice. But you used remainingAttendeeCapacity 2 times …
 *  Thread Starter [jedney](https://wordpress.org/support/users/jedney/)
 * (@jedney)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9805290)
 * Good spotting! Thanks.
 * The total spaces should have been “maximumAttendeeCapacity”.
 * Thanks again.
 *  [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * (@josiah-s-carberry)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9805572)
 * Thank you very much for this, [@jedney](https://wordpress.org/support/users/jedney/).
   I am sure each person may have somewhat different needs here.
    I, for one, am
   thinking of putting this code in the event template, as this gives me greater
   flexibility, according to the type of event. Also, I use #_EXCERPT instead of#
   _NOTES and #_EVENTPAGEURL instead of #_EXTERNALURL
 * What I don’t know, and perhaps someone here can help, is whether there is an 
   advantage to placing these tags in the header section rather than the body section.
 *  Plugin Author [Franky](https://wordpress.org/support/users/liedekef/)
 * (@liedekef)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9805627)
 * Well, I think meta-tags should be in the header section (I’m not sure google 
   indexes these in the page itself).
    See also [https://moz.com/blog/meta-data-templates-123](https://moz.com/blog/meta-data-templates-123)
   You can ask google to test your page: [https://search.google.com/structured-data/testing-tool](https://search.google.com/structured-data/testing-tool)
 *  Thread Starter [jedney](https://wordpress.org/support/users/jedney/)
 * (@jedney)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9805692)
 * Thanks Josiah, I might try some of those tags instead.
 * As it stands, my page passes the Google Structured Data Test fine.
 * I’m quite unsure on whether these should be in the HEAD or BODY. I agree Meta
   tags are usually in the HEAD. The code I used came from a generator I found online(
   and then supplemented with some examples from the Google docs). It spat the code
   out as a single block but didn’t specify where to put it. As the Meta blocks 
   are wrapped in DIV’s and SPAN’s I took it that the tags are designed to add extra
   markup to visible content (e.g. BODY content). I got the impression the JSON-
   LD method is more for when you want the tags hidden in the page (e.g. in the 
   HEAD section).
 * I didn’t want all the hassle of having to wrap and tag all the page as I had 
   just got it the way I wanted, so I cheated and used inline CSS on the parent 
   DIV (display:none) to hide all the Metadata 🙂
 *  [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * (@josiah-s-carberry)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9805831)
 * I’ve looked into this a little more and have found that the microdata are generally
   at the start of the element of the page that they describe. So, the microdata
   for an event are found at the start of that event, namely, within the body.
 * I have the impression, though, and am not quite sure, that Google doesn’t really
   care where in the page they occur.
 * The meta tags are indeed in the head, though.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Google Event Markup (JSON)’ is closed to new replies.

 * ![](https://ps.w.org/events-made-easy/assets/icon-256x256.png?rev=1856035)
 * [Events Made Easy](https://wordpress.org/plugins/events-made-easy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-made-easy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-made-easy/)
 * [Active Topics](https://wordpress.org/support/plugin/events-made-easy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-made-easy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-made-easy/reviews/)

## Tags

 * [events](https://wordpress.org/support/topic-tag/events/)
 * [json](https://wordpress.org/support/topic-tag/json/)

 * 8 replies
 * 3 participants
 * Last reply from: [Ambyomoron](https://wordpress.org/support/users/josiah-s-carberry/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/google-event-markup-json/#post-9805831)
 * Status: resolved