Search code examples
schema.orgmicrodatarich-snippetsgoogle-rich-snippets

Microdata (schema.org) - Event - empty startDate


Could anyone tell me what if the EducationEvent has not got startDate and endDate, because it is not known yet? If I set an empty value for it ($startIso is an empty string):

<meta itemprop="startDate" content="{{ $startIso }}" />

I get:

Error: Missing required field "dtstart".` error message in validator.

Here’s the code:

    <div itemscope itemtype="http://schema.org/EducationEvent">
      <h1 class="columns">
          <span itemprop="name">{{ $courseTypesDescription->course_type_name }}</span>
      </h1>

      <div class="dates columns">
        <div class="row">
          <div class="large-5 medium-6 columns">
            @if ($start != "")
              <meta itemprop="startDate" content="{{ $startIso }}" />
            @endif
            <i class="fa fa-calendar"></i>
            <span class="text">Start: </span>
            <span class="data"> @if ($start != "") {{ $start }} @else N/A @endif</span>
          </div>
          <div class="large-5 medium-6 columns end">
            @if ($exam != "")
              <meta itemprop="endDate" content="{{ $examIso }}" />
            @endif
            <i class="fa fa-pencil-square-o"></i>
            <span class="text">Exam: </span>
            <span class="data"> @if ($exam != "") {{ $exam }} @else N/A @endif </span>
          </div>
        </div>
      </div>

      <article class="description columns" itemprop="description">
          {{ $courseTypesDescription->course_type_desc }}
      </article>

    </div>

Solution

  • Your usage of Microdata with the Schema.org vocabulary is correct (if you make sure to remove the properties with empty values). Schema.org doesn’t define any required properties.

    It’s just that Google Search, according to their documentation, seems to require the startDate property for displaying the Events Rich Snippet (and also location if it’s a single event, and url if your page lists several events).

    If you don’t provide it, and if Google’s docs are correct, you won’t get (the chance for displaying) a Rich Snippet for your event. They probably require a future start date because they don’t like to display Rich Snippets for past events.

    That doesn’t mean that you should omit the markup. It can be useful for other consumers (even possibly from Google, unrelated to their Rich Snippets), and Google’s Rich Snippets guidelines might change in the future, allowing for other types of Event snippets.