February 11, 2014

Fix WordPress Missing Required Field and Hcard Error

Fix WordPress Missing Required Field and Hcard Error
Richsnippet Preview is tool on Google webmaster which check your website structure data and display it like seacrh engine display your site on search results, but some times when test it, you will found some error warning, for blogger you can read fix microdata check error on Blogger, and this article will show you how about fix WordPress missing required field and hcard error.

Common error warning  show on WordPress site about stucture data check is:

Error: Missing required field "entry-title".
Error: Missing required field "updated".
Error: Missing required hCard "author".

A little different with Blogger, to fix above error on WordPress, you must search where it located on your website document file, because it depend on your active theme or template, by default you can search single.php on your theme directory, find and change code like below:

To fix required field entry-title error :

<h1 class="title"><?php the_title(); ?></h1>

change to:

<h1 class="entry-title"><?php the_title(); ?></h1>

Missing required field updated:

<span class="date"><?php the_time('j F,Y'); ?></span>

change to:

<span class="date updated"><?php the_time('j F,Y'); ?></span>

Missing hcard author:

<span class="theauthor"><?php the_author_posts_link(); ?></span>
   or
<span class="theauthor"><?php the_author(); ?></span>

change to:

<span class="vcard author">
<span class="fn"><?php the_author_posts_link(); ?></span>
</span>

   or

<span class="vcard author">
<span class="fn"><?php the_author(); ?></span>
</span>

If you use framework or other WordPress theme which not use single.php to show three things above, you must search and find what is relevant file which show that information, sometimes it in loop.php, or function.php or content.php in theme directory.

My experience with my WordPress theme is in content.php, content-single.php, content-page.php, and  found one warning about: mydomain/tag/my-tag, and fix it from tag.php file, so how about yours?, you must find relevant file before fix about this error warning.

After finished, check: http://www.google.com/webmasters/tools/richsnippets

Thanks to visit.


You might want to see other posts:

2 comments:

  1. Hi .. I am savita .. in trouble with
    Missing required hCard
    i am using blogger not wordpress.. looking for this solution everywhere not solve :) if any blogger expert is here who like to help me please knock me
    reall i need help ..

    ReplyDelete
    Replies
    1. Hi,

      Maybe you can read from here http://myblog-note.blogspot.com/2014/02/fix-blogger-structured-data-testing.html

      Good luck

      Delete