WordPress “twenty twelve” and Rich Snippets Testing Tool

While playing around with my Google+ profile I noticed a posting about Google Authorship, i.e. linking postings from various web sites to your profile. Search results show your profile photo, if activated. This was nothing new for me. But nonetheless I tested the mentioned Google Rich Snippets Testing Tool with my web site and it threw the following error message multiple times:

Rich Snippets Error Missing required field "updated"

I quickly found out that the culprit was my theme “twenty twelve”. Its predecessor “twenty eleven” also led to this error messages, but other themes didn’t. So I dug myself into the PHP code (Appearance -> Editor) and narrowed it down to a single class definition in functions.php (ca. line 326) that had to be changed from “entry-date” to “updated”:

$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="updated" datetime="%3$s" pubdate>%4$s</time></a>',

I have not checked what the difference between “entry-date” and “updated” is, but I have not yet observed any negative consequences; so I will stick to the change. The code in the “twenty eleven” theme looks similar, so if you want to adapt it search for “entry-date” (only one occurrence) in the functions.php file.

8 Replies to “WordPress “twenty twelve” and Rich Snippets Testing Tool”

  1. Hi,
    I did what you said and it did remove the error from the Google rich snippet tester, however when I search for my site in Google the snippet is still not showing. Will I have to wait for it to be indexed again?
    Thanks for your help.

    1. Hi,

      in my case it took about a month until my Google+ profile was shown in the search results. You also need a bidirectional link between the website (e.g. your homepage) and your Google+ profile. The former can be solved with appropriate WordPress plugins (or with a rel=author link to your Google+ profile), the latter with a link to the page in the appropriate section (e.g. contributor) of your Google+ profile. Kai.

  2. Hi Kai!

    thanks for this post.
    you can simply combine the two classes, so you can be sure you don’t miss anything:
    %4$s

    Furthermore as far as i know, one month is a very long time to appear with your authorship in the results, my experience is, that if everything is setup well, it only needs some hours in order to appear in the results.

    Johannes

Leave a Reply

Your email address will not be published. Required fields are marked *