Skip to main content

SEOPress Event & Article Schema

Yoko Core cleans up the JSON-LD structured data SEOPress generates for events and posts, and adds the parts SEOPress's settings cannot express.

SEOPress's SEO → Schemas settings stay the source of truth for which field maps to what. This layer only tidies what SEOPress produced and fills the gaps. On a site that does not use the framework's event fields, SEOPress's output is left unchanged.

What it fixes​

For an event, it:

  • writes the dates in the format Google expects (2030-06-01T17:00), with no timezone attached — Google uses the venue's own timezone, which is correct for an event held elsewhere;
  • turns the plain address line into a structured address (street, city, state, country), so Google can read the location;
  • marks the event in person, virtual, or hybrid, from the Event Format assigned to it;
  • for a virtual or hybrid event, adds the online location (the registration link);
  • adds the ticket offer — the registration link and the public price;
  • sets the event's link to the event's own page, not the venue website.

For a post, it lets the byline come from an Author field instead of the WordPress user (see Author byline).

Setting up an event​

Three places, all in wp-admin:

WhereWhat to set
SEO → Schemas → Event schemaMap Start/End Date and Time to event_start_date, event_start_time, event_end_date, event_end_time. Set Location URL to the venue website field, or None.
The event's Event FormatAssign In Person, Virtual, or Hybrid. This is what sets the attendance mode. Assign both In Person and Virtual to mark an event hybrid.
The event's fieldsFill the venue, city, state, country, registration link, and non-member price. Empty fields are simply left out of the schema.

The Event schema's Start and End Date and Time, each mapped to a custom field

SEO → Schemas → the Event schema: Start and End Date and Time mapped to event_start_date, event_start_time, event_end_date, and event_end_time. The dates then come out correct; Yoko Core reformats them for Google.

The price shown is always the non-member price — Google wants the lowest price open to the general public, never the member rate.

Author byline​

Some sites credit a post to a name typed into an Author field rather than to the WordPress user who published it. When that field holds a name, the schema author becomes that person. When it is empty, SEOPress's WordPress-user author stands. The field is the same in the block editor and the classic editor.

A site points both its on-page byline and this schema at the same field, so the two can never disagree.

Checking a post's schema​

To see exactly what the filters produced for one post — without opening the page — run:

wp yoko schema show <post-id>
# BusinessEvent
{
"@context": "http://schema.org",
"@type": "BusinessEvent",
"name": "First Example Event",
"url": "https://example.com/event/first-example-event/",
"startDate": "2030-06-01T17:00",
"endDate": "2030-06-08T21:00",
"location": {
"@type": "Place",
"name": "Bradbury Building",
"address": {
"@type": "PostalAddress",
"streetAddress": "304 S Broadway St",
"addressLocality": "Los Angeles",
"addressRegion": "CA",
"addressCountry": "USA"
},
"url": "https://example.com/venue"
},
"eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
"offers": {
"@type": "Offer",
"url": "https://example.com/register",
"price": 100,
"priceCurrency": "USD"
}
}

The command renders the schema fresh from the current data, so it may differ from a page still served from a full-page cache.

For developers​

Two SEOPress filters are hooked, each of which passes only the built JSON-LD array (the current post comes from the queried object):

  • seopress_schemas_auto_event_json — the Event normalizer.
  • seopress_schemas_auto_article_json — the Article author override.

Every meta key, taxonomy slug, and default is a framework default and filterable, so a site with different field names overrides the default rather than the behavior:

FilterDefaultPurpose
yoko_seopress_event_city_meta_keyevent_location_event_cityCity sub-field
yoko_seopress_event_region_meta_keyevent_location_event_state_or_provinceState/region sub-field
yoko_seopress_event_country_meta_keyevent_location_event_countryCountry sub-field
yoko_seopress_event_registration_link_meta_keyregistration_linkRegistration link field
yoko_seopress_event_price_meta_keynon-member_pricePublic price field
yoko_seopress_event_currencyUSDOffer currency
yoko_seopress_event_format_taxonomyevent-formatAttendance-mode taxonomy
yoko_seopress_attendance_mode_mapin-person → offline, virtual → online, hybrid → mixedMaps Event Format term slugs to attendance modes
yoko_seopress_event_organizerSEOPress's organizerThe organizer; return null to remove it
yoko_seopress_article_author_meta_keypost_authorThe byline field
yoko_seopress_article_author{ Person, name }The resolved author; add a url or sameAs here

URLs added to the schema are passed through esc_url_raw with an http/https allowlist, so an unsafe value in a link field is dropped rather than emitted.