WordPress: How to Fix Missing required field entry-title, Update, hCard Error in Google Structured Data tool.

Harish Kumar · · 396 Views
WordPress: How to Fix Missing required field entry-title, Update, hCard Error in Google Structured Data tool.

Recently when I tested one of my WordPress weblogs via Google Structured Data testing tools, I got the following errors:

  1. Error: Missing required field “entry-title”.

  1. Error: Missing required field “updated”.

  1. Error: Missing required hCard “author”.

It was strange, as everything was already described in my WordPress theme codes, but still, I was getting the error and I had to resolve the problem.

What I noticed that it was described in the theme but not as Google wanted them to be. So, Here in this article, I’ll try to help out each and everyone in a simple way about how I resolved this issue.

Fixing “Error: Missing required field entry-title.”

In your WordPress theme’s single.php file. Here look for the the_title() function called. Let say this function is used in the following HTML format.

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

In this above code snippet, the entry-title class is missing, which is required according to the Google Structured Data testing tools. So, need to add an entry-title class to fix “Error: Missing required field entry-title” as below mentioned.

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

Fixing “Error: Missing required field updated.”

To fix this issue in single.php file look for the_time() function. Let say the_time() function is called in following html format.

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

In this above code snippet date, the updated class is missing which is required according to Google Structured tools. So, need to add this class to fix this issue.

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

Fixing “Error: Missing required hCard author.”

In single.php file look for the_author() function. It may be called in the following HTML format.

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

Here to fix this issue, we need to add the vcard author class as below described.

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

Now all is done. After this modification, these errors will be resolved.

0

Please login or create new account to add your comment.

0 comments
You may also like:

Use Transients API Caching and Speed Up Your WordPress Theme.

The Transients API in WordPress is an effective method for saving cached data in the database. It allows us to take resource-intensive queries and store them in short-term caches (...)
Harish Kumar

Remove api.w.org REST API/JSON API from WordPress header.

WordPress uses the REST API since edition 4.4 of the CMS. It allows developers to interact with the WordPress back-end more quickly since this API is a standard way to connect. (...)
Harish Kumar

How to Add Custom User Profile (User meta) Fields In WordPress

When you are focusing on tasks that need user management, and you need to add more fields for the user. In that case, here user meta functionality is used. This is similar to creating (...)
Harish Kumar

How to fetch Any post with WP_Query in WordPress?

WP_Query is your buddy. It allows you to get content from the database according to your requirements. In this article, I will explain top to bottom about how WP_Query works. let’s (...)
Harish Kumar

How to Enable Featured Image in WordPress?

Featured Images or Post Thumbnails is a theme feature. Most themes such as Genesis and other themes support featured images by default. A great way to determine whether your theme (...)
Harish Kumar

Extend the where clause in WordPress WP_Query

In WordPress, sometimes needing to modify WP_Query class to interact with your database. For example, let's say you want to find all posts that the title would contain a specific (...)
Harish Kumar