Technical Notes

My online notepad

  • Social


  • Support

    Donate towards my web hosting bill!

How to fix “missing required fields” warnings in Rich Snippets Testing Tool

Posted by Anton Khitrenovich on December 24, 2011

Several days ago I checked what Google’s Rich Snippets Testing Tool thinks about this WordPress-based blog. The results were not bad in general, but also not good enough for my understanding. While Google was able to detect that I am the owner of the blog and presented a link to my Google+ Profile, and the main page of the blog was correctly detected as a list of blog entries, each one with the permalink, a list of tags and a list of categories – the most important things were missing: the title, the date and the author of the post. The following errors were displayed for each blog entry:

Warning: Missing required field “entry-title”.
Warning: Missing required field “updated”.
Warning: Missing required hCard “author”.

Obviously, I started to check what can be done about that. This research lead me to the long list of articles about microformats, how they are used in Google’s Rich Snippets and how they are handled by WordPress.

To summarize what should be done:
In order for Google to properly detect the “missing” information (which actually appears on the page), it should be properly marked with meta-information elements (in this case – hAtom microformat). This is accomplished by adding special class to the HTML elements containing the relevant text. Sometimes the nearest surrounding element contains much more text than needed; in this case you can enclose the relevant part of the text in the dedicated “span” element – in this way you do not break existing formatting.

For the blog post, the title of the post should be marked with class “entry-title“, the posting date should be marked with class “updated” and the full name of the post author should be marked with class “author” accomplished by elements from hCard microformat – “vcard” and “fn“. The sample for this post will be:

<span class=”entry-title”>How to fix “missing required fields” warnings in Rich Snippets Testing Tool</span>
<span class=”updated”>December 24, 2011</span>
<span class=”vcard author”><span class=”fn”>Anton Khitrenovich</span></span>

Now, let’s take a look on how to do this in WordPress:
As you can see, the information we need already appears on the page, so it should be pretty simple to mark it with relevant microformat. The simplest way that I found to implement the changes was to modify some theme files directly*, via Theme Editor (you can find it under “Appearance” => “Editor” in the Admin Interface of your blog). Here is an example of such modification for the main blog page (“index.php” template) of Andreas09 theme; note that “class” attributes besides the “date” are new. (The whole snippet is indented for easier reading.)

There are two additional templates you will probably want to modify – “single.php” is the template of the single post and “archive.php” is the template for various post listings, such as posts by date, by tag and by category. You may also want to modify “search.php” (the template that displays search results), but I’m not sure about the actual effect of this modification.

Disclaimer: Implementation of the changes I suggested in your blog is at your own risk!


* Notes about direct theme modification:

  1. No, I did not find any WordPress plugin that can insert the required markup for you. It does not mean that such one does not exist at the moment of reading, especially if you read this page much later than the moment of writing.
  2. Yes, I know that touching the theme files directly is not recommended. In case the theme you are using for your WordPress blog is updated frequently (or at least maintained), it may make sense to wait for the theme update or just ask the author to add the microformats support. This is not the case for Andreas09 (used in this blog), which was last updated more than 5 years ago…

48 Responses to “How to fix “missing required fields” warnings in Rich Snippets Testing Tool”

  1. [...] How to fix “missing required fields” warnings in Rich Snippets Testing Tool [...]

  2. [...]  Podrobný postup a výsledný efekt, ako by to malo celé vyzerať nájdete tu: http://technotes.khitrenovich.com/fix-missing-required-fields-warnings-rich-snippets-testing-tool/ [...]

  3. [...]  Podrobný postup a výsledný efekt, ako by to malo celé vyzerať nájdete tu: http://technotes.khitrenovich.com/fix-missing-required-fields-warnings-rich-snippets-testing-tool/ [...]

  4. Rokib said

    I am also facing same problem here in http://www.eBioZone.com/ and http://TenBestHosting.com/ but this two theme is not as yours… And what I have to do ? Copy the name in all post ? Help me please… here in your code contains “posted by ‘your name'” What i have to do ?

    • For the first site, the change goes to the “content-single.php”. Find <?php the_author() ?> (somewhere around 20-th line) and surround it with two spans – one for class=”vcard author” and another for class=”fn”. This should do the job for you.

      The second site (TBH), while built on WP engine, does not look like a classic blog. I would not add microformats there at all.

      Hope it helps.

  5. It might be a silly question, but what are the implications of these warnings? I am reluctant to touch the files and it seems to come up fair enough in Google, at least using the testing tool. Thanks!

    • In case of your site – probably not too much of implications.
      I see those warnings for individual entries on the listing pages. However, the listing page itself has proper publisher data (goes to the G+ page) and each article has proper author data. So, adding author data for the individual entries also will probably not provide any additional info for Google.
      The only entry that may bring some benefit is publishing date. Google displays this data near the search result when available and some people may prefer to click the link, which clearly shows that it was updated recently.

      As usual, the decision is yours :)

      • Awesome, thanks so much for taking the time to check it out for me! I’ll see if I can do something about the publishing date as I often look at that myself when I look stuff up on Google. But thanks again!

  6. Hey great article!

    I was just about to do some modifications to my theme, but was wondering if you would take a look at the warnings I get from the Google rich snippet tool before I do anything? I personally don’t like them, but it seems as though everything is setup correctly.

    Looking forward to your thoughts – thanks!

    Nick

    • I see two warnings for your site, both related to the individual entries and not to the feed itself – one about “updated” timestamp and another about authorship hCard. According to the spec, both are mandatory. Yet, I see that authorship is detected correctly on the target page results, so it is mostly format compliance question. Regarding the update time – I see the “published” element in the markup, which (in theory) can be used to detect update time. Not sure whether Google does it or not, given the fact that “updated” field is also mandatory. Unfortunately, the Rich Snippets tool does not show the update time even for the pages where it appears correctly, so we cannot know if this assumption is correct. On another side, rating data that you have there may be considered as more interesting by some people.

  7. [...] How to fix “missing required fields” warnings in Rich Snippets Testing Tool [...]

  8. Anton, works as advertised. First article in about 15 that actually worked as advertised. Thank you!

  9. Hi,

    Great article, thanks for the info. I too have the “Warning: Missing required field “updated”.”, if you just look at my domain as a whole, the error shows up on every separate post. So would I need to edit my theme then? Looks like it has to do with the class of the date the post was published. I am using Genesis Framework, do you know if the change would be in index.php, or could I just change it in a child theme or custom css?

    1 more question, I just signed up Kara and Kelly for the Google Authorship and it looks like they are both setup nice (not showing in SERP yet after 3 days), but when you check the main domain it says it is not setup or may be set up? With 2 authors, how do I assign Google Authorship for the main domain, or do you just want it for each individual post?

    Thanks!

    • Re update date –
      You are right, it has to do with the class of the date span. It is marked with “published”, but not with “updated”. See my comments to Nick above – he has similar issue in the theme he is using. Anyway, I would recommend you to contact the authors of the Genesis Framework and ask them if they plan to update the class there.

      Re multiple authors –
      Unfortunately, I have no advises here – my blog is solely mine :)

      Good luck there!

  10. Karina said

    I have a few questions.

    The thing is I use WordPress more as a CMS than a blog.
    On my pages I prefer not to show when the page is updated and have commented this out, but for this reason I can not remove the error regarding “Missing required field”.

    Are Google going to punish this?

    I have tried to Google the issue, and maybe see if I could find some instructions on how to remove hatom completely from the WordPress template, but I don’t find any suggestions regarding this.

    Any help would be appreciated.

    • Well, if you say that the updated date has no meaning on your site, you’ll probably get no benefit if Google would be able to find it. I guess you can just ignore this warning.

  11. Debapriya said

    My blog link is http://devtunes.blogspot.in.
    I have the same problem.Please help me.

  12. Hi
    Its a lots to it. Im getting all confused about those snippets. I wonder if all this will work with directory themes?

  13. Nice article. I tried to do what you mention, but it seems different with my website. I use HostingMoz themes in WordPress, and I could find it.
    I also have same problem on ht rich snippet testing tool like that, but I still didn’t find any suitable solution. Anyway, thanks for the info

  14. I am Using Genesis Framework and I couldn’t find these lines anywhere in my theme. Please Can you explain me how To solve this problem on Genesis Framework?

  15. Ravi Singh said

    Hello
    I am also facing this type of problems, thanks for sharing this type of articles.Now i will solve my problems with the help of your tutorials.

  16. Rahul said

    Hello, I have the same problem with my website http://www.rahulkcjain.com
    I could not find the given codes in my single.php file. I am using the tonic theme of WordPress and have been trying to fix this issue since a week now.
    it would be great if anyone of you can provide me a fix for the same. Also, I am a newbie to the coding world, so step by step instructions would be appreciated..
    thanks in advance..

    • Hello Rahul,

      The Tonic theme is a bit more complex than one that I’m using here, and consists of more building blocks. In your case, the right code to modify appears in “content-header.php” template file. BTW, I see that in the latest version of Tonic theme the authors took care of “entry-title” and “updated” marks, so all that you need to handle is the correct detection of post author. A hint for you – check line 29 :)

      Good luck,
      Anton.

  17. […] http://technotes.khitrenovich.com/fix-missing-required-fields-warnings-rich-snippets-testing-tool/ […]

  18. Sadek said

    Thanks for this tutorial. I was getting similar errors, and this tutorial helped me to fix those.

  19. i found my answer, thanks a lot for the solution

  20. Anton, I’m having difficulty getting this to work for my site, my homepage is a list of the most recent 5 blog articles, and I get the errors about author, undated and entry-title five times each.

    I can view the source code for the individual blog entries, and everything is there, but I still get the errors, can you shed any light?

    Thanks

    Declsn

  21. […] need to add a few classes to selected elements in the Theme Editor. A few links that may help: How to fix ?missing required fields? warnings in Rich Snippets Testing Tool | Technical Notes How to Fix ? hfeed Warning: At least one field must be set for HatomEntry hatom-feed hatom-entry […]

  22. I did not manage to do this:-( my theme seems to be completely different. Lucky me!Can you please help me:-)

  23. O'neil said

    I was able to make the changes on my website. Many thanks Anton. You are the best!

  24. Morten said

    Thanks, this solved my problems too.

  25. Hi, most of this has gone well over my head as I am a non techie
    I am getting these errors on my page and like a previous poster I would not like to alter the coding.
    Error: Missing required field “updated”.
    Error: Missing required hCard “author”.

    My site http://www.asharart.me.uk
    Theme: Yoko
    Should I be worried about these errors? and as a non techie what is my best course of action?
    I have noted a decrease in drop in traffic to my site could these be a reason for the decline
    Best Sharon

    • Hi Sharon,

      Given that you see some decrease in traffic (and probably in ad revenues as a consequence), I would say that in your situation the best will be to hire a professional consultant. While I’m a techie :), I’m really not good enough in SEO and related to give any advises in the area.

      Best,
      Anton.

  26. utsav said

    thanks.. helpful for me
    keep it up

  27. Matt said

    Why do you use Hcard microformat? Schema.org is easier to implement.

Leave a Comment

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

%d bloggers like this: