How to remove hentry errors appearing in Google Webmaster Tools for my Wordpress Website
Closing Date: 17 January 16
Started on: 17 November 15
Participants: 1
Google webmaster is reporting hentry errors for my website, how can I get rid of it. I am currently using Avada Theme.
This challenge is listed under
Open Source
, Development & Implementations
and Data & Information Management
Community
Related Posts:
1 Suggestion
Generally Avada theme has an inbuild function that renders rich data snippets on the page like author, date posted, date udpated etc.
<?php echo render_rich_snippets_for_pages(); ?>
Add the above code on pages like page.php, single.php, author.php and other pages on which you are getting this error.
For other wordpress themes, please follow the instructions below..
First create the following function in your Themes >> Includes >> theme_function.php
function render_rich_snippets_for_pages( $title_tag = TRUE, $author_tag = TRUE, $updated_tag = TRUE ) {
global $smof_data;
$html = '';
if( ! $smof_data['disable_date_rich_snippet_pages'] ) {
if( $title_tag ) {
$html = '<span class="entry-title" style="display: none;">' . get_the_title() . '</span>';
}
if( $author_tag ) {
ob_start();
the_author_posts_link();
$author_post_link = ob_get_clean();
$html .= '<span class="vcard" style="display: none;"><span class="fn">' . $author_post_link . '</span></span>';
}
if( $updated_tag ) {
$html .= '<span class="updated" style="display:none;">' . get_the_modified_time( 'c' ) . '</span>';
}
}
return $html;
}
Then add the following code on pages like page.php, single.php, author.php and other pages on which you are getting this error.
<?php echo render_rich_snippets_for_pages(); ?>
Note: Add it in the place where the details of the blog post is fetched.
After adding the code, please wait for couple of days for Google to crawl the pages and update the date in the search console. Else you can visit https://developers.google.com/structured-data/testing-tool/ and test the same.