51Wordpress LogoResolving Google’s Rich Snippets Testing Tool errors

Published on by in Wordpress. Updated 18th April 2013.

Update!

This art­icle has now been super­ceded by an updated art­icle, which has been updated to use MicroData (schema.org) instead of Micro­Formats.  If you still wish to use Micro­Formats read on, but I recom­mend using MicroData and invite you to read the new art­icle, which will con­tinue to be updated with new inform­a­tion and new themes.

Please note

I have moved the ori­ginal con­tents of this post to new posts as the num­ber of themes I have instruc­tions for increases. There are now spe­cific instruc­tions for Mys­tique 2, Mys­tique 3ThesisTwenty eleven and Me Gusta by Cosmos

The ori­ginal Mys­tique 2 art­icle is the most detailed if you are look­ing for addi­tional inform­a­tion.  Below I have provided a gen­eric idea of what is required and where to start when try­ing to modify a new theme

Part 1: Author­ship information

You need 3 parts for this — you need each post to con­tain a link to your author page, you need your author page to have a link to your google pro­file (or google+ page) and you need your google pro­file (or google+ page) to have a link point­ing to your domain!

Deal with these in reverse order.

  1. Log in to google+ or your google pro­file and add a pub­lic (it does need to be pub­lic) link in your pro­file inform­a­tion point­ing to your web­site.  For example — on my google+ pro­file I have a link to http://diymediahome.org
  2. Use the code provided by Yoast to put a link to your google+ pro­file on your author page
    • Install the Yoast SEO plu­gin or add the yoast code to functions.php
    • Go to your user inform­a­tion page (Dash­board: Users: Your Pro­file) in word­press and fill in the Google+ field (or Google Pro­file field if you used the yoast code) with a link to your google profile
    • Edit your theme’s author.php, find the code which dis­plays the author inform­a­tion (twit­ter account, web­site, etc.) and add an extra part in the same style to out­put the google+ link.  Make sure the href has a rel="me"
  3. Add code so that the author inform­a­tion for each post links to your author pro­file page with a rel="author"
    • This is the trick­i­est bit — it may involve mul­tiple edits to mul­tiple files.  Start by look­ing at single.php (which does single pages), index.php, search.php, archive.php etc.  Look for the code which has a href="" to the author page and add in rel="author"

Part 2: Required hCard inform­a­tion (e.g. updated, entry-title etc.)

Each post needs some cor­rectly struc­tured markup con­tain­ing sum­mary inform­a­tion about it.

  1. These edits will prob­ably go in the same places as at least some of the author edits in instruc­tion 3 in part 1.  Likely loc­a­tions are single.php, page.php, index.php, search.php, archive.php
  2. In many cases it is simply a case of adding some rel="" entries to the exist­ing code — e.g. if your theme already shows an updated or pos­ted line inside a p or inside a span you can add rel="updated" to that p or span
  3. You also need to add some more author related code — again, assum­ing you have the author name shown at the top of each post it is easy to add it there
    • you need your name inside a tag with a rel="fn".
    • This tag needs to be inside a par­ent tag with a rel="vcard"
  4. All of these extra tags need to be inside a par­ent ele­ment (maybe even the body tag) which has a rel="hentry". Most themes already have this code present

Note: Using rel="updated" on the date the post was pub­lished works, but strictly speak­ing isn’t always cor­rect.  If you have actu­ally updated a post then the updated and pub­lished dates will be dif­fer­ent.  Google will recog­nise both (as will humans if you show it) so it is bet­ter to add a bit of code that checks if the post has been updated.  To get the pub­lished date use the func­tion get_the_date() and to get the updated date use the func­tion get_the_modified_date().  If it has been updated then dis­play both the pub­lished date (with rel="published") and the updated date (with rel="updated").  If the post hasn’t been updated then just put the pub­lished date with rel="updated published".  An example of code which does this is included with the Thesis theme modi­fic­a­tions article.

Think we’ve missed something? Let us know by commenting below. If you would like to subscribe please use the subscribe link on the menu at the top right. You can also share this with your friends by using the social links below. Cheers.

Leave a Reply

Fill in your details below or click an icon to log in:

51 Responses to “Resolving Google’s Rich Snippets Testing Tool errors”

    • Jon Scaife

      What theme are you using? If it’s a paid-for theme you’ll need to either send me a copy or give me access to the files some­how so I can have a look. If it’s a free theme just let me know and I’ll get back to you with some instruc­tions, or pre-edited files.

      Reply
    • Jon Scaife

      If you can send me a zipped up copy of your theme I’ll have a look in the next day or 2. I see the funky URL — oops :)

      Reply
      • Al

        Jon, i have 2 word­press sites that i can get the google snipptes To Work.
        Can you help me?
        If so please con­tact me ..

        Albert

        Reply
        • Jon Scaife

          What theme are you using? If it’s a paid-for theme you’ll need to either send me a copy or give me access to the files some­how so I can have a look. If it’s a free theme just let me know and I’ll get back to you with some instruc­tions, or pre-edited files.

          Reply
  1. govpatel

    Hello

    I am using a Artisteer soft­ware to cre­ate my theme and I am get­ting same error

    Extrac­ted struc­tured data
    hatom-feed
    hatom-entry:
    Warn­ing: At least one field must be set for Hat­o­mEntry.
    Warn­ing: Miss­ing required field “entry-title”.
    Warn­ing: Miss­ing required field “updated”.
    Warn­ing: Miss­ing required hCard “author”.

    Can you help me with what I need to do to clear the error.

    Govindji Patel

    Reply
    • Jon Scaife

      You’re build­ing a cus­tom theme?
      Have a look at the code for one of the examples — the twenty eleven theme is prob­ably a good example to look at. If you’re still strug­gling, when you’ve fin­ished your theme, send me a zipped copy and I can look at it for you. Cheers :)

      Reply
  2. Shariar

    HI,
    Can you please help me out with
    Warn­ing: Miss­ing required field “updated”.
    Warn­ing: Miss­ing required hCard “author”.

    Here is what in my content-single.php

    at

    i’ve tried with <span class=“fn“
    at
    But no luck

    Reply
    • Jon Scaife

      I think your com­ment got mangled and some­how wasn’t flagged up to me as one I hadn’t replied to — I’m sorry about that. Have you got your theme fixed now? If not, get in touch and I’ll see what I can do to help you sort it out

      Reply
  3. Martin Smith

    Hey Jon,

    I’ve just sent a mes­sage via your con­tact page. I’m hav­ing real issues try­ing to fig­ure out the Rich Snip­pets on a word­press page i’m work­ing on.

    Thanks,
    Martin

    Reply
    • Jon Scaife

      Hiya Mar­tin,

      I see you’ve got author­ship inform­a­tion work­ing ok — it’s just the
      “updated” and “author” hcard parts for each post that are fail­ing the
      test­ing tool.

      I’ll have a look and see what I can do — what theme are you using?

      Thanks

      Reply
  4. Shimul Mahmud

    Thanks for art­icle…
    I’m using the word­press theme “slid­ing door”. I can’t find the file “lib\php\post.class.php” in my theme…

    I get these errors show­ing for my site:

    Warn­ing: Miss­ing required field “updated”.
    Warn­ing: Miss­ing required hCard “author”

    Please help me…

    Reply
    • Jon Scaife

      That file is spe­cific to the Me Gusta theme, you wont find it in your theme. You should try the gen­eric instruc­tions or the instruc­tions for Mys­tique 2 or Twenty Eleven — have a look in index.php, single.php, archive.php etc.

      If you’re still strug­gling zip the theme up and e-mail it to me and I’ll take a look.

      Reply
  5. Afif

    Hi, I am using a premium theme and just can’t seem to find the cor­rect line. Sent you an email with the theme. Hope you can have a look at it.

    Thanks a bunch

    Reply
    • Afif

      I can’t thank you enough, I no longer have the errors thanks to your fix.
      I must com­mend you for your reply being faster than I could expect from the premium theme provider.

      Thanks again

      Reply
  6. Nick Keizer

    Thanks for this article.

    I have the author­ship veri­fied now and it’s work­ing for all pages. The prob­lem I’m hav­ing is I can’t get these errors cleared:

    Warn­ing: At least one field must be set for Hat­o­mEntry.
    Warn­ing: Miss­ing required field “entry-title”.
    Warn­ing: Miss­ing required field “updated”.
    Warn­ing: Miss­ing required hCard “author”.

    I’m using Mys­tique ver­sion 2.4.2 which I have mod­i­fied con­sid­er­ably (that may be the prob­lem). I did exactly as you spe­cify and I even added the and lines in sev­eral other files (index.php, author.php, archives.php, etc.), but still no luck.

    Any other sug­ges­tions? Thanks for any help you can provide!

    Nick

    Reply
    • Jon Scaife

      I’ll have a look at Mys­tique 2.4.2 in the next week and update the instruc­tions if things have changed. If not I’ll have to have a look at your mod­i­fied code. Will let you know in next few days.
      Cheers

      Reply
      • Jon Scaife

        D’oh — I was being dopey — Mys­tique 2.4.2 is quite old. I some­how read it as 3.4.2. For 2.4.2 I would have thought my ori­ginal set of instruc­tions should work (the ones prior to the update).

        Reply
    • Jon Scaife

      I’ve updated the article(s) and cre­ated sep­ar­ate posts for Mys­tique 2 and 3 to avoid con­fu­sion. The Mys­tique 2 instruc­tions work for Mys­tique 2.4.2 — let me know how you get on :)

      Reply
  7. Lisa

    What if you don’t have a single PHP file? I have those exact errors as you stated above. I have a cus­tom theme. Thanks!

    Reply
    • Jon Scaife

      Have a look at the tem­plate hier­archy docs. I’m guess­ing if you don’t have single.php the first place to look is index.php but cus­tom themes are some­times a pain to fig­ure out. If you’re still strug­gling you can zip up your whole theme and e-mail it to me to have a look at.

      Reply
  8. Sam Kear

    Thanks for the guide, it worked great for me. This had been bug­ging me for a while and I’m glad to finally have it fixed.

    Reply
    • Jon Scaife

      A pleas­ure

      one other tip — google don’t seem to like it if you have more than 1 type of rich snip­pets in use. Cur­rently it seems only micro­formats actu­ally work, but google are recom­mend­ing microdata and i anti­cip­ate they will switch soon. I would recom­mend includ­ing all the data for both, but exclud­ing the ini­tial item­type and item­scope. This pre­vents google recog­nising the microdata and avoids the prob­lem of hav­ing more than 1 type, but means that when google do switch all you have to do is re-add the item­type and item­scope and all the rest of the microdata will show up. you can then remove the micro­formats con­tent at your leis­ure. The rich snip­pet test­ing tool will hap­pily val­id­ate both types at once, its only things like recipes (where you need to be white lis­ted) where hav­ing both types is a prob­lem.
      I think its a shame google have opted for microdata rather than micro­formats. Microdata was lower over­head in a way because it doesn’t require any new prop­er­ties — its eco­nom­ical to use classes as you can also apply styles to them. on the other hand, microdata is less con­fus­ing for pre­cisely the same reason — if there is an item­prop or item­type or item­scope you know its for microdata and if there is a class you know its for styl­ing. I guess over­all its a score draw. I believe bing are back­ing microdata too, so pre­sum­ably that means yahoo as well, which makes for pretty much the entire Eng­lish lan­guage search engine market

      Reply
  9. Harald

    Thanks very much for this article.

    I used this, even I have the zBench theme:

    <span class=“value-title” title=””>
    <span class=“value-title” title=””>

    in order to solve these problems:

    Warn­ing: Miss­ing required field “entry-title”.
    Warn­ing: Miss­ing required field “updated”.
    Warn­ing: Miss­ing required hCard “author”.

    Now, when check­ing with the
    Rich Snip­pets Test­ing Tool
    http://www.google.com/webmasters/tools/richsnippets
    all is fine AS LONG AS I check on single post level, e.g.
    http://www.mediawireless.eu/2012/seo-pr-suchmaschinenoptimierung-public-relations/
    but it is still not ok, when check­ing the domain only
    http://www.mediawireless.eu/

    Any idea, help or suggestion?

    Best, Har­ald

    Reply
    • Jon Scaife

      What file(s) did you edit? The index page (and archive pages) are often gen­er­ated using a dif­fer­ent PHP file. If you edited single.php you might also need to edit index.php or archive.php. If that IS the case you may also need to edit page.php search.php and author.php if they exist. Dif­fer­ent themes do it dif­fer­ent ways

      On the plus side, if you’ve got it work­ing on single posts you’re 95% of the way there :)

      Reply
  10. Rob Cairns

    On one site I am work­ing on run­ning Gen­esis with no child theme, I am still hav­ing an error. can you make a sug­ges­tion Jon? The error is : Warn­ing: Miss­ing required field “updated”. with the full txt below.

    Thanks

    Rob

    hfeed
    hentry
    entry-title = Win a Copy of Pic­ture Col­lage Maker Pro for Win­dows
    entry-content = Noth­ing delights me more than dis­cov­er­ing afford­able, easy to use soft­ware that will allow me to have fun cre­at­ing unique, last­ing memor­ies with pic­tures. My good friend Shan­non over at Coupon…
    pub­lished = 03/26/2012
    hcard
    fn = Jean Parks
    Rel
    name = Win a Copy of Pic­ture Col­lage Maker Pro for Win­dows
    rel = book­mark
    url = http://www.theshoppinqueen.com/win-copy-picture-collage-maker-pro-windows
    Rel
    name = View all posts in Giveaways
    rel = tag
    url = http://www.theshoppinqueen.com/giveaways
    Warn­ing: Miss­ing required field “updated”.

    Reply
    • Jon Scaife

      Yep. You have a “pub­lished” field, but not an “updated” field. If you want to do a “quick fix” you can just add class “updated” to the same class as “pub­lished” (e.g. so span class=“published” becomes span class=“published updated”. Strictly tho, if you update a post you’ll be sup­ply­ing incor­rect data, so when I’ve done edits I’ve edited the PHP to check if the post has been updated. If it hasn’t then the out­put is exactly as above, but if the post has been updated then I out­put 2 spans, one with the pub­lished date and one with the updated date and apply an appro­pri­ate span to both.
      Hope­fully the above makes sense and you can sort it, but if it doesn’t then gimme another shout. You can always use the form on the about page to send me e-mail and then maybe send me the file in ques­tion for me to have a look at.

      Reply
    • Jon Scaife

      Thanks Muhammad — those look like great instruc­tions for blog­ger users. Cheers for shar­ing the link :)

      Reply
  11. noskill1343

    Warn­ing: At least one field must be set for Hcard.
    Warn­ing: Miss­ing required field “updated”.

    I have same prob­lem, but in blog­spot, any sug­ges­tion?
    I try to remove hfeed and hentry, but rich snip­pet still not works

    Reply
    • Jon Scaife

      You can’t remove hfeed and hentry and expect rich snip­pets to work
      You need to add some tags. Lets assume the the “hfeed” and “hentry” are classes applied to 2 nes­ted divs. Inside the inner div (with class “hentry”) you need another tag (prob­ably a div, span or p) with the hcard stuff (via classes). You also need another tag with class=“updated” and inside that tag you need the updated date for the post. The easi­est way to do this is to just add class=“updated” to the exist­ing con­tainer for the updated date inform­a­tion. I don’t use blog­ger so I can’t tell you exactly how off the top of my head, but if you can’t fig­ure it out drop me another shout and I’ll sign back up for blog­ger and sort some code for you. If you do man­age to fix it, it would be great if you could post below (or e-mail me) to let us know how you fixed it. Sorry for the delay reply­ing, it’s been a very busy couple of weeks. Cheers :)

      Reply
      • noskill1343

        Hi, thanx a lot for your reply, my prob­lem has been solved, rich snip­pet is appear per­fectly in Google local (google.co.id), but not appear in google.com.

        Reply
  12. darko kovancives

    How do I add this code to the thesis theme? single.php does not exist in the thesis folders.

    Reply
    • Jon Scaife

      Without know­ing what files you do have I can’t say. Unless I’m mis­taken Thesis isn’t a free theme so I can’t have a look at it. Assum­ing it uses the stand­ard Tem­plate Hier­archy I’d guess that the code would be some­where in index.php. In my exper­i­ence though it is more likely that index.php will be quite short and prob­ably pulls in other files. Start by look­ing in index.php and if you get no luck zip a copy of index.php up, stick it up some­where and send me the url and I’ll have a look.

      Reply
  13. m33r4

    Hi there. I have cre­ated my recipe snip­pet but get­ting the fol­low­ing error code and I truly don’t know how to rec­tify that:

    Extrac­ted rich snip­pet data from the page
    hrecipe
    Warn­ing: At least one field must be set for Hrecipe.
    hrecipe
    Warn­ing: At least one field must be set for Hrecipe.

    Help please?

    Many thanks.

    Reply
  14. Gaurav Ekka

    finally cor­rec­ted the

    Warn­ing: At least one field must be set for Hcard.
    Warn­ing: At least one field must be set for Hat­o­mEntry.
    Warn­ing: Miss­ing required field “entry-title”.
    Warn­ing: Miss­ing required field “updated”.
    Warn­ing: Miss­ing required hCard “author”.

    Thank you Jon

    Reply