fix warning missing fields google rich snippets

Rich Snippet is a additional feature in Google search that show additional info about page listed in search, specially Author, Date, Ratings etc. Rich snippets are displayed reading microformats or RDFa in the web pages. According to some sites, rich snippets can improve the SEO of the site (though I haven’t seen any change).
If you are thinking of putting rich snippets in WordPress then the chances are, you might face snippets error such as:
Warning: Missing required field “entry-title”
Warning: Missing required field “updated”
Warning: Missing required hCard “author”

fix warning missing fields google rich snippets

To fix these errors you need to modify single.php file, the instruction on fixing these errors along with code in given below.

Warning: Missing required field “entry-title”

This error occurs when Google snippet cannot find the title.
<h1><?php the_title(); ?></h1>
<h1 class="title single-title entry-title"><?php the_title(); ?></h1>
note: some themes has h2 instead of h1.

Warning: Missing required field “updated

This error occur when Google Snippet cannot find date it was published or last updated.
To solve this find,
<span class="post_date"><?php the_time('j F,Y'); ?></span>
and replace it with
<span class="post_date date updated"><?php the_time('j F,Y'); ?></span>

Warning: Missing required hCard “author”

This error occur when Google is unable to find the author of the post. This part use elements from hCard microformat which are ”vcard” and ”fn”.
To solve this,
Find : <?php the_author(); ?>,
and replace it with;
<span class=”vcard author”><span class=”fn”><?php the_author(); ?></span></span>

Editing these usually fixes all the error related to Google snippets and make your wordpress theme compatible with Rich Snippets. You check the error in rich snippet from Rich Snippets Testing Tools.

If you are having “Connection not secure” error in WordPress. Please have a look at this post.

( ! ) Warning: A non-numeric value encountered in /home/nepauvyx/ on line 352
Call Stack
10.05644034792{main}( ).../index.php:0
20.05654036664require( '/home/nepauvyx/' ).../index.php:17
30.540551388112require_once( '/home/nepauvyx/' ).../wp-blog-header.php:19
40.568851379840include( '/home/nepauvyx/' ).../template-loader.php:74
50.691952602544locate_template( ).../single_template_3.php:53
60.691952602656load_template( ).../template.php:643
70.692152612864require_once( '/home/nepauvyx/' ).../template.php:684
80.713652677328td_module_single_base->related_posts( ).../loop-single-3.php:44
90.714052695792td_block_related_posts->render( ).../td_module_single_base.php:906
100.735252845896td_block->get_block_pagination( ).../td_block_related_posts.php:45