Ask your WordPress questions! Pay money and get answers fast! (more info)

WP Extracted structured data Google Webmaster Search Appearance WordPress

Error on the report below:

Error: Missing required field "updated".
Error: Missing required hCard "author".

Extracted structured data
hatom-feed
hatom-entry:
entry-title: Directions and Maps
entry-content: DESTINATION DIRECTIONS & MAPS View Larger Map All major and domestic airlines serve Chicago’s O’Hare International Airport. Transfer time from the airport to the Hotel, depending on traffic
Error: Missing required field "updated".
Error: Missing required hCard "author".

Answers (2)

2014-02-18

Dbranes answers:

Did you have a look at this:

[[LINK href="http://www.acceleratormarketing.com/trench-report/google-analytics-errors-and-structured-data/"]]http://www.acceleratormarketing.com/trench-report/google-analytics-errors-and-structured-data/[[/LINK]]


where it's suggested to use:

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

<span class="post-date updated"><?php the_date(); ?></span>

2014-02-19

Bob answers:

To remove updated error for your posts go to wp-content/themes/twentyfourteen/inc/template-tags.php file

you will find function <em>twentyfourteen_posted_on</em> at line on 108. Replace it with new one.
Notice word <strong>updated</strong> in below code.

function twentyfourteen_posted_on() {
if ( is_sticky() && is_home() && ! is_paged() ) {
echo '<span class="featured-post">' . __( 'Sticky', 'twentyfourteen' ) . '</span>';
}

// Set up and print post meta information.
printf( '<span class="entry-date"><a href="%1$s" rel="bookmark"><time class="entry-date updated" datetime="%2$s">%3$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%4$s" rel="author">%5$s</a></span></span>',
esc_url( get_permalink() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
get_the_author()
);
}


I think other problem is you are trying to fetch data for Page not Post.
Page do not contain date and author data.

to add those information in page but not display to end user add this in content-page.php file in your theme right before
<em><div class="entry-content"></em> div at line no 17

<div style="display:none;">
<?php twentyfourteen_posted_on();?>
</div>