Hentry Errors In Google Search Console For WordPress Website

March 20, 2018 2:32 pm 0

Do you often work on Google Search Console? Have you ever notice the option Structured Data in Search Appearance? There is one more option in Structured Data. It is “hentry (markup: microformats.org)”. This section shows the list of error associated with the hentry data structure.

Hentry errors

You must be wondering what this Hentry is!!!!

We will get into that. We will also discuss how can you fix this error and what benefits are there for your website. This Hentry error can be a tricky one but thanks the god for spawning you with a WordPress website. It makes it easy for you to fix the hentry error.

First, let’s understand what hentry is. So, without further ado, let’s get you started.

What Is Hentry?

Microformats.org explained brilliantly what Hentry is. According to them, when a root class name designates the existence of an hAtom entry, that root class is named as hentry. So, you can say that hentry is a part of hAtom. It usually shows the way to the search engine that the content in the web blog is available for syndicated. In simple language, it is a block that has the posts which can be displayed in the feeds.

Search engine bots need the title of the post, the main content of the body, the name of the author, and the publishing date. Hentry helps the search engine bots to find these items in one place.

Then where the problem lies???

It is clear from above that, in order to parse hentry, you need those above entries. In general, Pages don’t show the date of publication and the name of the author.

WordPress then descend as a guardian spirit. It automatically adds the hentry no matter what the post is about when the WordPress theme uses post_class( ).

In short, if you are getting an error, then your WordPress theme is not following these steps.

Benefits When You Fix Hentry Errors

Hentry is a structured data, right? A Structured data guides the search engine to understand the content of your website in the much better way. Suppose, your website has a review of some random post on your website and you want Google to show the review in the search results.

This is where structured data will help you. They will convey the message to the search engine that, “Dear Google, this website wants to display review stars, please show the users the review of the product” in computer codes.

Before you do any of that, you must understand that there is no such thing as official Google ranking factor of structured data. Here you are not doing any SEO hack for better ranking. It is just an activity to make your website easier for your user.

In addition to that, if you don’t want to fix the error, then just don’t. There is no penalty or fall in your SEO ranking for not fixing the Hentry error. It is just to make sure that your user grasps the information you want to share from your WordPress website easily.

Fixing The Hentry Error

Force Removing The Error

One of the easiest way to remove the error is to remove the element. You must be wondering like WHAT!!!!

Yes, as I mentioned above, if you don’t fix the issue, nothing is gonna happen to the SEO ranking of your website. All you need to do is simply add the following snippet code to the functions.php of your WordPress theme and the hentry will be removed from your WordPress website. This will also stop Google from showing you the hentry errors. The snippet code for that is given below:

// Source: https://wpcolt.com/fix-hentry-errors-wordpress/
add_filter( 'post_class', 'remove_hentry' );
function remove_hentry( $class ) {
  $class = array_diff( $class, array( 'hentry' ) );
  return $class;
}

Now, let’s move to the real fix of the hentry error.

The Authentic Fix

First things first. You need to make some amendments before you start fixing this issue. You need to go to your WordPress theme’s files. Your theme structure is not same now (I reckon you must have observed that). So, you must specify the location of the error.

Don’t worry!!! It is easy to locate the location of the occurrence of the errors. Google Search Console got you covered in that.

  • First, click Search Appearance on the Top left side of the screen, then select Structured data option.
  • Now near the bottom of the page, you will see an option as “hentry” under the Data Type Column.
  • If the error is in page URL, then the error must be in the page.php file; If the error is in the post URL, then the error probably present in the single.php; while if the error is in a category URL, you will find the error in the archive.php file.

Once you find the location of the errors, all you need to do is fix them with appropriate action. Have a look at this subsection.

Is Your File Missing Author?

When you find that the author vcard CSS class is missing, then you need to look for such code:

<?php the_author(); ?>

Once you find the code, replace it with this code:

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

Is Your File Missing Title?

When you find that the page or post is missing the “entry-title” CSS class, you need to add the entry-title in the code. Then the code will be like this:

<h1 class="entry-title">The title</h1>

Is Your File Missing The Updated Class?

There is a possibility that your page or the post is missing the “Updated” CSS class. Make sure that you create it correctly.

But before you jump off to the code, look for time function first. It will look like this:

<span class="date updated published"><?php the_time(); ?></span>

You must be aware that this will make the updated time and the published time same. If you want to mention the updated time separately, you need to make sure that you add this function:

$updated_time = get_the_modified_time('F jS, Y');

After this you have to add this code:

<span class="updated"> '.$updated_time.'</span>

How Would You Test The Changes?

Making use of Google Structured Data Testing Tool will help you in finding any error related to your structured data hierarchy. If there is an error, it can be identified with this tool. It is very easy to use. Have a look at what it looks like:

Hentry structure

What Do You Think

No hentry errors

I hope this guide will help you in identifying the hentry errors and fix them. Do you think hentry errors are important to fix? You know it doesn’t have any SEO relevance. Let me know your thoughts via the comments section.

Author Bio

Morris Edwards is a developer and a decorated developer at Awebstar. He is in this field for over 10 years. He has developed many web applications that helped many small businesses to grow emphatically. He has a thing for writing about new ideas in business, technology, and innovations. When not blogging, he loves to travel around.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.